Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: PropertyGrid: Show object's child member

$
0
0
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.

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>