How to use 'Selector' control for non-enum properties (PropertyControl)

Jul 16, 2012 at 4:57 PM

I want  to edit simple property of type string or int, but instead of using default property editor I want to specify list of items from which user can pick one. It should look like Enum, but i need to specify items manually at runtime

I could create my own combobox in IPropertyControlFactory.CreateControl, but i think there is better way to specify ItemsSource and let DefaultPropertyControlFactory to create the selector control.

What's the recommended way to let user to pick value from list of values?

Jul 16, 2012 at 5:13 PM

Ok, ItemsSourceProperty does this for me, but is there a way to specify SelectedValuePath and DisplayMemberPath?

The goal is to edit property of type int, but show list of items with description, not just list of integers.

Jul 16, 2012 at 5:18 PM

And another question :)

Is there other way to find this out than to look at source codes?

Aug 9, 2012 at 12:20 AM

You need to override the CreateComboBoxControl to set SelectedValuePath/DisplayMemberPath.

Sorry, the library is still under construction so the source code is the only (and 100% accurate :-) documentation. I try to add XML comments on all properties/methods, hope that helps a bit. Read the example source codes.