Using Triggeraction for more than one control

Nov 3, 2010 at 3:13 PM

Hello !

What is the best way to use a Triggeraction for more than one control ?

e.g. i have a menuitem and a button which both have to trigger the same method.

Or is there a other best way to practice ?

Thank you for an answer !


(p.S. this is an WPF application)

Nov 3, 2010 at 3:26 PM

One TriggerAction corresponds to one control/event combination. So for each control/event you want to route, you need a TriggerAction.

In your example, you'd have two TriggerAction controls, one for the menuitem and one for the button.

This is not unlike commanding, where you have to link the command to the menuitem and the button, but both commands route to the same handler.