I Have A wpf UserControl with a property:
private IEnumerable<PropertyBase> properties;
public IEnumerable<PropertyBase> Properties
{
get {return properties;}
set
{
properties = from property in value
orderby property.Position
select property;
}
}
I want to create a ListBox that is bound to my Properties property with Property.Name as the displayed value, all the examples I'm finding use DataProviders in separate classes and appear to overcomplicate the situation. Is there a simpler way of achieving this.
I tried the following but no data was displayed:
<ListBox Name="propertiesListBox" ItemsSource="{Binding Source=this, Path=Properties}" DisplayMemberPath="Name" />