I have a Menu with three items and I'm trying to change the background color when the mouse hovers over any of the items. I've tried the IsMouseOver & IsHighlighted trigger property and neither works.
In my App.xaml:
<Style TargetType="MenuItem" x:Key="MenuItemStyle" >
<Style.Triggers>
<Trigger Property="MenuItem.IsHighlighted" Value="true">
<Setter Property="Background" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
In my Main.xaml:
<Menu HorizontalAlignment="Left" Height="30" VerticalAlignment="Top" Width="975
" FontFamily="Tempus Sans ITC" FontSize="16" >
<Menu.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFC8C8C8" Offset="0"/>
<GradientStop Color="Black" Offset="1"/>
</LinearGradientBrush>
</Menu.Background>
<Menu.Foreground>
<SolidColorBrush Color="#FFFFFFFB"/>
</Menu.Foreground>
<MenuItem Header="New" Click="MenuNew_Click" VerticalAlignment="Center" Padding="15,4,8,3" Width="60">
<MenuItem.ToolTip>
<ToolTip>
Add new Park
</ToolTip>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem Header="Search" Width="65" Padding="12,4,8,3" >
<MenuItem.ToolTip>
<ToolTip> Select search option</ToolTip>
</MenuItem.ToolTip>
<MenuItem Header="Name" Background="Black" FontSize="14" Style="{StaticResource MenuItemStyle}" />
<MenuItem Header="ID" Background="Black" FontSize="14"/>
<MenuItem Header="OwnerName" Background="Black" FontSize="14"/>
</MenuItem>
</Menu>