Hi, I've created a collection of dynamic properties and some of the properties are marked with specific attributes. Based on the attributes I would like to style the property name so the user can distinguish between different property types -to make it clearer to the user. I can change the background colour (based on one of your other forum posts) but how would I do it so I can add an Icon next to the display name or better still include the icon left of the actual editor.
There is no Content element on the PropertyGridDataAccessorItem as it inherits from TreeListViewItem. Is there anyway that I can change the Template for a TreeListViewItem where by I can insert a ‘type icon’ based on the property attribute
“Property Name” “Property Type Icon” “Property Editor”
If I wanted to build the template in code then I guess I could do it with a binding similar to the xaml below but I'm not sure how to build the template so I get the DisplayName, an Icon amd then the Editor .. am I going down the wrong path here?Thanks for any help you can give.
There is no Content element on the PropertyGridDataAccessorItem as it inherits from TreeListViewItem. Is there anyway that I can change the Template for a TreeListViewItem where by I can insert a ‘type icon’ based on the property attribute
“Property Name” “Property Type Icon” “Property Editor”
If I wanted to build the template in code then I guess I could do it with a binding similar to the xaml below but I'm not sure how to build the template so I get the DisplayName, an Icon amd then the Editor .. am I going down the wrong path here?
<propgrid:PropertyGrid.Resources>
<Style TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}">
<Style.Triggers>
<Trigger Property="DataAccessorType" Value="Property">
<Setter Property="Template" Value="{Binding DataContext, RelativeSource={RelativeSource Self}, Converter={StaticResource PropertyTypeToBooleanConverter}}" />
</Trigger>
</Style.Triggers>
</Style>
</propgrid:PropertyGrid.Resources>