I have following code
private static ObservableCollection<myColor> myItems = new ObservableCollection<myColor>();
myItems.Add(new myColor("red"));
When object myColor is this class
public class myColor
{
public string color { get; set; }
public myColor(string col)
{
this.color = col;
}
}
Trouble is when I try to show item in listbox
<ListBox Margin="12,52,12,12" Name="listBox1" ItemsSource="{Binding}" />
It only shows "myColor" object instead of "color" variable. How can I show variable from this object?