I have a DataTemplate that is displaying objects with three fields, e.g.:
Name = "Font Color"
Value = "Orange"
Editable = "True"
but I want to display them as e.g.:
Font Color: Orange Editable
But I'm having trouble finding the syntax to use Triggers here in order to e.g. display "Editable" when the field Editable="True"
Does anyone know the syntax to do this?
The following code results in "Binding cannot be used in Property":
<DataTemplate x:Key="settingsItemTemplate">
<StackPanel Orientation="Horizontal">
<Label Content="{Binding XPath=Name}" ContentStringFormat=" {0}:"/>
<Label Content="{Binding XPath=Value}"/>
<Label>
<Label.Triggers>
<Trigger Property="{Binding XPath=Editable}" Value="True">
<Setter Property="Content" Value="Editable"/>
</Trigger>
<Trigger Property="{Binding XPath=Editable}" Value="False">
<Setter Property="Content" Value="NOT Editable"/>
</Trigger>
</Label.Triggers>
</Label>
</StackPanel>
</DataTemplate>