简体   繁体   English

WPF:停止关闭ContextMenu

[英]WPF : Stop a ContextMenu from closing

A Context Menu automatically closes when the user clicks outside of it. 当用户在其外部单击时,上下文菜单会自动关闭。 Is there a way to stop it from closing ? 有没有办法阻止它关闭? I tried setting the StaysOpen property to true but failed to get the desired result. 我尝试将StaysOpen属性设置为true但未能获得所需的结果。

Thanks for any help! 谢谢你的帮助!

不清楚你想才达到什么了一下,也许你应该使用弹出代替你随时都可以将其关闭。

使用ContextMenuClosing事件.... “要禁止关闭上下文菜单,事件的处理程序应将其标记为已处理”来自msdn doc - http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement。的ContextMenuClosing%28VS.90%29.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM