Property Control editors

Apr 3, 2012 at 11:16 AM

How to change editor for particular field, or datatype? e.g. i want to to use my own ItemsControl instead SimpleGrid for my List<T> properties.

In other words, i'm looking for PropertyEditor.Editors alternative in PropertyControl.


Apr 3, 2012 at 12:51 PM

ok, I've found solution:

var propertyFactory = (propertyControl.PropertyControlFactory as DefaultPropertyControlFactory);
propertyFactory.Editors.Add(new TypeEditor( 
     editedType: typeof(SourceTile), 
     editorTemplate: (DataTemplate)this.FindResource("myEditorDataTemplate")));

It is good candidate for sample project ;)

Apr 5, 2012 at 1:34 AM

yes, that's one solution! You can also subclass the DefaultPropertyControlFactory and override the CreateGridControl method.

I agree that there could be more examples/documentation on this. Will add it later!