开发者

How to disable context menu in WPF?

开发者 https://www.devze.com 2023-01-07 20:31 出处:网络
I have two Menu items in a wpf context, I bind them with command, how do I hide context menu when both items are n开发者_运维百科ot available, I mean when both commands cannot be executed?Add an even

I have two Menu items in a wpf context, I bind them with command, how do I hide context menu when both items are n开发者_运维百科ot available, I mean when both commands cannot be executed?


Add an event handler for ContextMenuOpening event. Set Handled property in ContextMenuEventArgs object to true and the context menu will not open.

0

精彩评论

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

关注公众号