Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 wpf 上下文中有两个菜单项,我将它们与命令绑定,当两个项目都不可用时如何隐藏上下文菜单,我的意思是当两个命令都无法执行时?
为 ContextMenuOpening 事件添加事件处理程序。将 ContextMenuEventArgs 对象中的 Handled 属性设置为 true,上下文菜单将不会打开。