Hi,
I believe I have found a problem when PropertyGrid is constructed using a series of PropertyGridPropertyItem instead of using SelectedObject property on a PropertyGrid. In the latter case a TypeConverter is correctly used when displaying/changing properties in a PropertyGrid. If a PropertyGrid is modified to use a series of PropertyGridPropertyItem entries, TypeConverters are never used.
To replicate the issue, please open MainControl.xaml of "Custom TypeConverters QuickStart" of your own Sample Browser and simply copy the PropertyGrid found there to another Grid column. Then modify one of the ProperyGrids not to use SelectedObject but instead specify a single PropertyGridPropertyItem like so:Build and run the app. Please notice how changing the value of MyDouble in any of the PropertyGrids is updated in the other but also please notice that the modified PropertyGrid neither uses a TypeConverter to format nor parses the value as temperature (just a plain double).
Is there some documented way to achieve the same functionality when using a PropertyGridPropertyItem or is this really a bug? Can one explicitly specify a TypeConverter on a PropertyGridPropertyItem? I have noticed that there is a read-only Converter property on IPropertyDataAccessor.
Alternatively, is there an attribute for tagging a class property that a PropertyGrid understands and omits a particular property when using a SelectedObject?
Thanks!
I believe I have found a problem when PropertyGrid is constructed using a series of PropertyGridPropertyItem instead of using SelectedObject property on a PropertyGrid. In the latter case a TypeConverter is correctly used when displaying/changing properties in a PropertyGrid. If a PropertyGrid is modified to use a series of PropertyGridPropertyItem entries, TypeConverters are never used.
To replicate the issue, please open MainControl.xaml of "Custom TypeConverters QuickStart" of your own Sample Browser and simply copy the PropertyGrid found there to another Grid column. Then modify one of the ProperyGrids not to use SelectedObject but instead specify a single PropertyGridPropertyItem like so:
<propgrid:PropertyGridPropertyItem ValueName="MyDouble" Value="{Binding Source={StaticResource TestObject},Path=MyDoubleWith}" />
Is there some documented way to achieve the same functionality when using a PropertyGridPropertyItem or is this really a bug? Can one explicitly specify a TypeConverter on a PropertyGridPropertyItem? I have noticed that there is a read-only Converter property on IPropertyDataAccessor.
Alternatively, is there an attribute for tagging a class property that a PropertyGrid understands and omits a particular property when using a SelectedObject?
Thanks!