我XAML页面设置这样一个触发器,为什么没有起到效果呢
<Window x:Class="ProDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" Name="FrmMain">
<Window.Resources>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Button Content="Button" Height="43" Margin="12,48,356,218" Name="btn" Width="135" Click="btn_Click" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="12,20,0,0" Name="txt" VerticalAlignment="Top" Width="479" />
</Grid>
</Window>
鼠标移到按钮上面,应该是要变成橙色才对,但是一点反应都没有,请问是咋回事呀
------解决方案--------------------------------------------------------
<Style TargetType="{x:Type RibbonLib:RibbonButton}">
<Setter Property="Focusable" Value="False"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RibbonLib:RibbonButton}">
<Grid Cursor="Hand">
<!--背景色-->
<Border x:Name="back" Opacity="0.8" CornerRadius="3" BitmapEffect="{DynamicResource {ComponentResourceKey RibbonLib:Skins, RibbonActiveButtonBitmapEffect}}" Background="{DynamicResource {ComponentResourceKey RibbonLib:Skins, RibbonActiveButtonBrush}}">
<!--前景色及边框-->
<Border x:Name="fore" BorderThickness="1" CornerRadius="3" BorderBrush="{DynamicResource {ComponentResourceKey RibbonLib:Skins, RibbonActiveButtonBorderBrush}}">
<Border.Background>