I have the following piece of code:
<Style TargetType="{x:Type ribbon:Button}">
<Setter Property="ToolTip" Value="{Binding Label}" />
</Style>
This works fine, but why doesn’t this works or what is the correct way of doing this:
<Style TargetType="{x:Type ribbon:Button}">
<Setter Property="ToolTip">
<Setter.Value>
<ToolTip Content="{Binding Label}" />
</Setter.Value>
</Setter>
</Style>
The reason of doing the same is i wanted to change other property of Tooltips like placement etc.. which is only possible by 2nd method
Here’s the “long form” of the setter that you’re after:
Edit #1 Actually, I tested your version and it also seems to work exactly as well. But it’s not exactly correct, because you’re setting the ToolTip’s content to be another ToolTip.
Edit #2 Set the ToolTip Placement like this: