Sami
Sami

Reputation: 99

How to bind a RibbonButton to a command with parameters?

I have a ribbon with many ribbon-tabs and ribbon-buttons. This a common Ribbon that act on many views. I'm in a situation that I need a reference to the XamDataGrid in order for the ribbon-button hooked command to execute properly.

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.

Please note that I'm using MVVM.

Thank you

Upvotes: 1

Views: 504

Answers (1)

leapold
leapold

Reputation: 133

Look at telerik site. 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!"/>

Upvotes: 2

Related Questions