Open ms-somanna opened 3 years ago
I'm trying to change the tooltip of a ToggleButton when ToggleButton is Checked/Unchecked using Style.Triggers as shown in code below.
Style.Triggers
<hc:ButtonGroup Margin="4,0,0,0" Orientation="Horizontal" Style="{StaticResource ButtonGroupSolid}" hc:BorderElement.CornerRadius="4" hc:BorderElement.Circular="True"> <ToggleButton> <Path Data="{Binding Source={StaticResource PerspectiveViewCube}, Path=Data}" Height="15" Width="15" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Uniform" Fill="Gray" Stroke="{DynamicResource PrimaryTextBrush}"/> <ToggleButton.Style> <Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource ToggleButtonBaseStyle}"> <Setter Property="ToolTip" Value="Turn ON Perspective View"/> <Style.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter Property="ToolTip" Value="Turn OFF Perspective View"/> </Trigger> </Style.Triggers> </Style> </ToggleButton.Style> </ToggleButton> </hc:ButtonGroup>
But its not working. The ToolTip is not displayed wether the ToggleButton is checked or unchecked. But if I set the style using BasedOn="{StaticResource ToggleButtonCustom}" it works. For any other Style it doesn't work.
BasedOn="{StaticResource ToggleButtonCustom}"
I did not look at the source code, but if it does not work, the tooltip not implemented
I'm trying to change the tooltip of a ToggleButton when ToggleButton is Checked/Unchecked using
Style.Triggers
as shown in code below.But its not working. The ToolTip is not displayed wether the ToggleButton is checked or unchecked. But if I set the style using
BasedOn="{StaticResource ToggleButtonCustom}"
it works. For any other Style it doesn't work.