Недавно начал изучать WPF. И наткнулся на проблему, когда наводишь на кнопку она становится голубой. Поискав в интернете нашёл решение проблемы. И я сделал стиль на кнопку. Но вот проблема, стиль на кнопку не применяется. P.S На элементах внутри кнопки прозрачный фон.
Стиль:
<Style x:Key = "TriggerStyle" TargetType = "Button">
<Setter Property = "Foreground" Value = "Blue" />
<Style.Triggers>
<Trigger Property = "IsMouseOver" Value = "True">
<Setter Property = "Foreground" Value = "Green" />
</Trigger>
</Style.Triggers>
</Style>
Кнопка:
<DockPanel HorizontalAlignment="Left" Width="200"
ScrollViewer.VerticalScrollBarVisibility="Disabled" Background="#FF141414">
<Button Content="Main" Height="45" VerticalAlignment="Top" Width="200" DockPanel.Dock="Top"
Style="{StaticResource ButtonSubMenu}" FontSize="22"/>
<StackPanel Height="114" VerticalAlignment="Top" Width="200" Background="#FF232323">
<Button Style="{StaticResource TriggerStyle}" Height="30" Background="#FF2D2D2D"
Foreground="White" HorizontalAlignment="Left" Width="200" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Width="181" Height="30">
<fa:ImageAwesome Icon="Terminal" Foreground="White" HorizontalAlignment="Right"
Width="26" StretchDirection="DownOnly" Height="22" Margin="0,4"/>
<TextBlock Text="Console" FontSize="18" Margin="10,0,0,0"
HorizontalAlignment="Left"/>
</StackPanel>
</Button>
</StackPanel>
</DockPanel>