ComboBox ItemTemplate does not support values of type 'Image'
- by Charlie
I'm trying to bind a WPF combobox to an observable collection of images.
Here is my collection:
public class AvatarPhoto
{
public int AvatarId { get; set; }
public BitmapImage AvatarImage { get; set; }
}
public ObservableCollection<AvatarPhoto> AvailableProfilePictures { get; private set; }
Here is my xaml:
Visual Studio gives me this compile time error:
Property 'ItemTemplate' does not support values of type 'Image'.
Why is this error seen?
Thanks
Update: thanks for the answer! It solved the problem.
Now I have updated my code but I'm seeing this in the ComboBox:
Why is it not displaying pictures correctly? In the debug window I can see my collection is correctly populated: