locked
ImageSource not recognized in SampleData from Class RRS feed

  • Question

  • I want to create a sample data source from a class in Expression Blend 4.

    So I created a class Customer and a CustomerCollection that inherits from ObservableCollection<Customer>.

    The code looks like this:

     

    public class Customer
    {
       public string Name { get; set; }
       public ImageSource Picture { get; set; }

    }

    public class CustomerCollection : ObservableCollection<Customer{}

    Everything works fine, except that the Picture property of time ImageSoruce is not recognized as a Image. Therefore I cannot select sample data for it.

     

     

    Can anyone help me how to get the property recognized correctly?

     

    Thanks.

    Christian Moser
    www.wpftutorial.net

    Tuesday, April 19, 2011 12:14 AM

All replies

  • Hi!

    when I need to create sample images the Picture property is of type string, and contains the path to the image, instead of ImageSource. Then I bind Source property of the Image class to Picture Property.

    Hope this helps!


    Sergio Garrido. Mi Blog
    Friday, April 29, 2011 9:09 PM