Silverlight dynamic loading problem

I am creating a FlippingBook Silverlight application and I am facing a problem that I cannot solve.

The problem is Asyncrously Load Images. I wrote a class that loads an image from webaddress and stores it in a BitmapImage object.

I am binding to this image object to the image source on a silverlight color control. Now my page and thumbnail have the same ImageData property that stores image data.

The thumbnail list is a list that was created as a thumbnail view.

Both the book and the list have the same source elements, so the problems baffle me.

Everything works with images being loaded in the background and updating the UI when they were loaded ... EXCEPT the first 3 (and always the first 3) items in the thumbnail list, the images are never displayed.

This image is to illustrate the user interface and issue: alt text http://www.pcbuyersguide.co.za/picture.php?albumid=19&pictureid=895

Image of the code binding on the page:

    <Image Source="{Binding ImageData}" Stretch="Fill" ImageFailed="Image_ImageFailed"/>

      

Image of code binding on thumbnail (Styled ListboxItem):

    <Image Stretch="Fill" Source="{Binding ImageData}"/>

      

Property:

   public BitmapImage ImageData
    {
        get { return oImageData; }
        set
        {
            if (value != this.oImageData)
            {
                this.oImageData = value;
                NotifyPropertyChanged("ImageData");
            }
        }
    }

      

I've tested images which take a long time and everything works, but it's these first 3 that give me hell. I don't understand how the elements are related and should be effectively the same.

ItemSource is observable. I know I haven't given much information, but I want to try and focus my question. If you need more information, I will be happy to provide it.

Any help would be greatly appreciated.

+2


source to share


1 answer


This turned out to be a styling issue on the ItemContentStyle that I defined. I had the Grid set to a certain fixed size, which Silverlight seems to dislike, so I set the size on the image and did some other adjustments and it looks like it worked.



+2


source







All Articles