MouseOver Trigger firing on ContextMenu with overridden ControlTemplate. Where is it coming from?
- by Dabblernl
I have this very simple ControlTemplate:
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border
Name="Border"
Background="{StaticResource BlueBackground}"
BorderBrush="LightBlue"
CornerRadius="10"
BorderThickness="1" >
<StackPanel IsItemsHost="True"/>
</Border>
</ControlTemplate>
I made it to create a nifty jawdroppingly beautiful rounded corner! However, when I point the mouse over a contextmenu a MouseOver Trigger fires from somewhere that draws a terribly ugly nearly square border on top of my nifty rounded border!
Where is it coming from??
EDIT:
The most likely cause is that the ContextMenu is an ItemsControl that holds MenuItems, even when my ContextMenu holds a single UserControl. So the UserControl is seen as a MenuItem and highlighted when the IsMouseOver==true! What is the easiest way to disable this behaviour?