Our designer is going nuts about this and I just cannot find the right search keywords to figure out how to fix it.
Menus and ContextMenus in WPF have “reveal” animations associated with them. We want to eliminate those without messing with system settings. I managed to pull the template out using Blend but there’s nothing in there about animations. Must be inheriting it from somewhere?
Can someone help? Any ideas would be appreciated.
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
ControlTemplates, threeStyles, twoBrushes, the list went on. Use Blend to “Edit a Copy” of any MenuItem.Inside the
ControlTemplaterelevant to aMenuItem‘s sub-menus is a control primitive called aPopup, declared like this:Note the
PopupAnimationproperty; it points toSystemParameters.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
MenuItems in your app:AllowsTranparency="False"; orMenuItemfor your application, removing thePopupAnimation‘s reference to the OS animation.You could then author your own triggers for animating how that popup appears.