I want to keep Background of toggle button transparent on style trigger "Is checked = true".
I Want the button to stay flat even after the button is checked.
I am talking about WPF XamRibbon.
Yes I am talking about ToggleButton.
I want to change its style while the button is checked. It is giving some dark background which I am trying to set to white.
Following code I have written which is not setting the background to white.
Also If u can guide me how can i make it appear flat in checked state also.
<igRibbon:ToggleButtonTool.Style> <Style TargetType="{x:Type igRibbon:ToggleButtonTool}"> <Setter Property="Template" Value="{StaticResource RibbonButtonToolTemplate}"/> <Setter Property="LargeImage" Value="Assets/Images/huprofile-blue.png" /> <Setter Property="Foreground" Value="#B00020" /> <Setter Property="Background" Value="Transparent" /> <Style.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter Property="LargeImage" Value="Assets/Images/huprofile-orange.png"/> <Setter Property="Foreground" Value="OrangeRed" /> <Setter Property="Background" Value="White" /> </Trigger> </Style.Triggers> </Style>
</igRibbon:ToggleButtonTool.Style>
Hello Anushri,
I am glad that you find my suggestion helpful. Thank you for using Infragistics components.
Regards,Bozhidara Pachilova
Thanks
<ToggleButton Content="WPF ToggleButton" Height="20" > <ToggleButton.Style> <Style TargetType="{x:Type ToggleButton}"> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="Foreground" Value="#B00020" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Background="Transparent" Height="20" > <Image Source="rocket.png" Width="16" Height="16" VerticalAlignment="Center" /> <TextBlock Text="WPF ToggleButton" Width="100"></TextBlock> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter Property="Foreground" Value="OrangeRed" /> </Trigger> </Style.Triggers> </Style> </ToggleButton.Style> </ToggleButton>