Pass eventArg to ActionMessag as part of input trigger

Topics: Actions & Coroutines
Sep 25, 2012 at 2:30 AM
Hi! I'm following the instructions here to create input triggers that call a method on my view model. I tried the convention of MethodName="myMethod($eventArgs)" bit it gets passed as null. What I want to do is map a keyboard event to a method on my view model, but I want the event to be handled so the key press doesn't propagate. It turns out that the key press seems to propagate from my UserControl to the parent window which also attempts to handle it. Any ideas?
Sep 25, 2012 at 8:08 PM
Edited Sep 25, 2012 at 8:08 PM

Check out the latest source. We've got a KeyBinding sample in there that you might find interesting. Honestly, I can't remember the behavior of the key events in that...whether they continue to bubble or not. Either way, you can usually stop a WPF event from bubbling with this:

e.Handled = true;