Hi,
I would like to set the ColorPropertyEditor (or NullableColorPropertyEditor) for some string property named "Color".
I managed to accomplish that by the following:
<grids:PropertyGrid IsSummaryVisible="False"
DataObject="{Binding Path=ActivitySettings}">
<grids:PropertyGrid.PropertyEditors>
<grids:PropertyEditor PropertyName="Color">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="grids:IPropertyModel">
<editors:ColorEditBox BorderThickness="0"
Value="{Binding ValueAsString, Mode=TwoWay}"
IsReadOnly="{Binding IsReadOnly}"
CommitTriggers="{Binding ValuePropertyEditor.CommitTriggers}"
HasPopup="{Binding ValuePropertyEditor.HasPopup}"
IsArrowKeyPartNavigationEnabled="{Binding ValuePropertyEditor.IsArrowKeyPartNavigationEnabled}"
IsEditable="{Binding ValuePropertyEditor.IsEditable}"
IsNullAllowed="True"
PlaceholderText="{Binding ValuePropertyEditor.PlaceholderText}"
SpinnerVisibility="{Binding ValuePropertyEditor.SpinnerVisibility}"
SpinWrapping="{Binding ValuePropertyEditor.SpinWrapping}"
DefaultValue="{Binding ValuePropertyEditor.DefaultValue}"
HasSwatch="{Binding ValuePropertyEditor.HasSwatch}"
IsAlphaEnabled="{Binding ValuePropertyEditor.IsAlphaEnabled}"/>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
</grids:PropertyGrid.PropertyEditors>
</grids:PropertyGrid>
However, I wonder if there's a better more elegant way.
So... is there?