How can I use a property trigger in a style (or other method) to change a property (e.g. ToolTip) that already has a value defined by the binding?
I have a simple button:
<Button Name="Button1" Style="{StaticResource ButtonStyle}"
ToolTip="{Binding Name}" >My Button</Button>
It has a tooltip binding to show the Name property for a set of classes as a DataContext.
My problem is that I want to show the name when the button is on, but something else when it is disabled. I thought I could get around my problem with style and trigger:
<Style TargetType="Button" x:Key="ButtonStyle">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="ToolTip" Value="Disabled" />
</Trigger>
</Style.Triggers>
</Style>
But that does not work. If I removed the tooltip binding from the button, then I will get the correct tooltip when the button is disabled. But it seems that I cannot have both a binding and a trigger on the same property.
I could get around this by adding another trigger:
<Trigger Property="IsEnabled" Value="true">
<Setter Property="ToolTip" Value="{Binding Name}" />
</Trigger>
4 5 , ToolTip, () , .
?