简体   繁体   English

如何将RibbonButton绑定到带有参数的命令?

[英]How to bind a RibbonButton to a command with parameters?

I have a ribbon with many ribbon-tabs and ribbon-buttons . 我的ribbon有很多ribbon-tabsribbon-buttons This a common Ribbon that act on many views. 这是作用于许多视图的常见Ribbon I'm in a situation that I need a reference to the XamDataGrid in order for the ribbon-button hooked command to execute properly. 我处于一种情况,我需要引用XamDataGrid才能正确执行ribbon-button挂钩的命令。

I have no clue how to pass a reference to the Ribbon or even deal with it keeping in mind this a common Ribbon menu. 我不知道如何传递对功能区的引用,甚至不知道如何处理它,请记住这是一个常见的Ribbon菜单。

Please note that I'm using MVVM . 请注意,我正在使用MVVM

Thank you 谢谢

Look at telerik site. 看看telerik网站。 http://docs.telerik.com/devtools/wpf/mvvm-helpers/common-event-to-command-behavior http://docs.telerik.com/devtools/wpf/mvvm-helpers/common-event-to-command-behavior

<telerik:EventToCommandBehavior.EventBindings>
<telerik:EventBinding Command="{Binding CustomCommand}" EventName="MouseLeftButtonDown" RaiseOnHandledEvents="True"
                      CommandParameter="This is a command parameter!"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM