In short, decyclone is right; it's coming from the OS, but here's why:
The default template for a MenuItem contains the markup and logic for displaying submenus. Look there.
When I opened a copy of a MenuItem template I found no fewer than four ControlTemplate
s, three Style
s, two Brush
es, the list went on. Use Blend to "Edit a Copy" of any MenuItem.
Inside the ControlTemplate
relevant to a MenuItem
's sub-menus is a control primitive called a Popup
, declared like this:
<Popup x:Name="PART_Popup"
AllowsTransparency="true"
Focusable="false"
HorizontalOffset="-2"
IsOpen="{Binding IsSubmenuOpen,
RelativeSource={RelativeSource TemplatedParent}}"
PopupAnimation="{DynamicResource
{x:Static SystemParameters.MenuPopupAnimationKey}}"
Placement="Right"
VerticalOffset="-3">
Note the PopupAnimation
property; it points to SystemParameters.MenuPopupAnimationKey
. That's the thing that's animating your menu.
This gives you two choices that occur to me, both of which will require that you define a custom template for the MenuItem
s in your app:
- Re-configure PART_Popup so that
AllowsTranparency="False"
; or
- Re-template
MenuItem
for your application, removing the PopupAnimation
's reference to the OS animation.
You could then author your own triggers for animating how that popup appears.