如何禁用 WPF 中的上下文菜单?
我在 wpf 上下文中有两个菜单项, 我用命令绑定它们,当这两个项目都不可用时,我的意思是当两个命令都无法执行时,如何隐藏上下文菜单?
I have two Menu items in a wpf context,
I bind them with command, how do I hide context menu when both items are not available, I mean when both commands cannot be executed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为 ContextMenuOpening 事件添加事件处理程序。将 ContextMenuEventArgs 对象中的 Handled 属性设置为 true,上下文菜单将不会打开。
Add an event handler for ContextMenuOpening event. Set Handled property in ContextMenuEventArgs object to true and the context menu will not open.