deep object graph inspection

Grids for WPF Forum

Posted 9 years ago by Markus Springweiler
Version: 9.2.0512
Avatar
Hello,

I need a quick and short way of inspecting arbitrary object graphs. A "..." right beside of every unknown property type, opening a fresh new property-grid window on the unknown object (including the same "..." buttons), would be perfect.

I tried adding a unnamed/untyped PropertyEditor (with just a ValueTemplate set) to BuiltinEditors.PropertyEditors -- which should have the lowest priority according to your "precedence of property editor defintions" table:
BuiltinEditors.PropertyEditors.Add(
                new PropertyEditor { ValueTemplate = (DataTemplate)this.Resources["dummy"] });
But this template then takes over EVERYTHING but System.Boolean (Checkboxes).

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Markus,

That is correct. By default, typeof(bool) and typeof(bool?) are mapped to BuiltinEditors.CheckBoxValueTemplateKey. Along with one for typeof(Brush), these are the only default entries in BuiltinEditors.PropertyEditors.

When checking for a property editor, if the PropertyGrid doesn't find a matching entry (using the precedence logic) it will use BuiltinEditors.DefaultValueTemplateKey. Since you've added an entry that will match any property, it is used for all properties (but is trumped by the default entries described above).

If you have a set of known types, then you'd probably want to set BuiltinEditors.DefaultValueTemplateKey to the "unknown" template. Then you'd have to make a separate entry in BuiltinEditors.PropertyEditors for each "known" types.

[Modified at 01/22/2010 12:45 PM]


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 10 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.