开发者

WPF : Stop a ContextMenu from closing

开发者 https://www.devze.com 2022-12-22 13:55 出处:网络
A开发者_如何学C 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 truebut failed to get the desi

A开发者_如何学C 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.

Thanks for any help!


Use ContextMenuClosing event.... "To suppress closing context menus, handlers of the event should mark it as handled" from msdn doc - http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.contextmenuclosing%28VS.90%29.aspx


A bit unclear what you are trying to achive, maybe you should use Popup instead so you can close it whenever you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消