I have a complex object of type A. A has a member of type List<B>. Lets refer to that member as Docs. In the PropertyGrid, when I encounter an object of type A, I want to show Docs instead (which should use the CollectionEditor). How do I accomplish this?
I looked into setting up a custom editor for type A. This almost works... I can set the EditorTemplate for A. In that template, I set the Data Template and can do the following:
<TextBlock Text="{Binding Path=Value.Docs.Count}"/>
This works - the Textblock shows the number of items in List B as expected. However, what I really want to do is something more like:
<CollectionEditor Items="{Binding Path=Value.Docs}"/>
This doesn't work of course, because the CollectionEditor has no such property and is loaded through the PropertyGrid.
I looked into setting up a custom editor for type A. This almost works... I can set the EditorTemplate for A. In that template, I set the Data Template and can do the following:
<TextBlock Text="{Binding Path=Value.Docs.Count}"/>
This works - the Textblock shows the number of items in List B as expected. However, what I really want to do is something more like:
<CollectionEditor Items="{Binding Path=Value.Docs}"/>
This doesn't work of course, because the CollectionEditor has no such property and is loaded through the PropertyGrid.