How to disable WPF ContextMenu animations?

前端 未结 3 1039
伪装坚强ぢ
伪装坚强ぢ 2020-12-15 22:57

I\'m trying to hunt down what bit I need to tweak to get ContextMenus in WPF to stop animating when they appear/disappear.

From what I can tell, WPF creates a Popup

3条回答
  •  情话喂你
    2020-12-15 23:35

    In your previous question, Rob showed you the reason why it acts like that. Can you not create a new ControlTemplate for your ContextMenu and set PopupAnimation property to None like the following :

                   
    

    You could create your own ContextMenu or apply a ControlTemplate using the shown code to specific instances.

提交回复
热议问题