如何禁用 WPF RibbonSplitButton 控件中的下拉按钮
我正在使用 WPF Ribbon 4。我有一个带有菜单项下拉菜单的 RibbonSplitButton
控件。 当我将 RibbonSplitButton 的 IsEnabled 属性设置为 false 时,仅顶部按钮被禁用,而不是打开下拉菜单的按钮。
提前致谢。
I am using WPF Ribbon 4. I have a RibbonSplitButton
control with dropdown menu of menu items.
When I set IsEnabled
property of RibbonSplitButton
to false only top button becomes disabled, not the button which opens dropdown menu.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过创建自己的分割按钮、继承 RibbonSplitButton 并添加一个依赖属性来解决这个问题,我可以绑定该属性以单独启用或禁用分割按钮。
在 XAML 中:
I solved this problem by creating my own split button, inheriting from RibbonSplitButton and adding an dependency property that I can bind to for enabling or disabling the split button alone.
and in XAML:
您可以简单地将 DropDownOpened="RibbonMenuButton_OnDropDownOpened" 添加到 WPF,然后
You can simply add a DropDownOpened="RibbonMenuButton_OnDropDownOpened" to the WPF and then