Hi,
I have a propertyGrid where I add properties dynamically. This propertyGrid I implement this way:
<propgrid:PropertyGrid IsSummaryVisible="True" AreDefaultSortDescriptionsEnabled="False"
AreCategoriesAutoExpanded="False" SelectedObject="{Binding SelectedObject}"
IsAsynchronous="True">
<propgrid:PropertyGrid.PropertyEditors>
<propgrid:DialogTextBoxPropertyEditor PropertyName="ImagePath"/>
<propgrid:ComboBoxPropertyEditor PropertyName="MyCollection" />
</propgrid:PropertyGrid.PropertyEditors>
</propgrid:PropertyGrid>
And properties for this propertyGrid defined :
[LocalizedCategory("Properties"), LocalizedDisplayName("DisplayMyProperty"), LocalizedDescription("DescMyProperty")]
public ObservableCollection<int> MyCollection
{
get
{
_myCollection.Add(2);
_myCollection.Add(3);
return _myCollection;
}
set
{
_myCollection = value;
RaisePropertyChanged("MyCollection");
}
}
private ObservableCollection<int> _myCollection = new ObservableCollection<int>();
So the problem is that property MyCollection is shown like combobox, but values are not populated. I mean in my property value field I see System.Collections.ObjectModel.ObservableCollection`1[System.Int32], and when I expand this combobox, there are no values.
Where I am wrong or may be there is an example of populating combobox with dynamic properties?