I am attempting to have a key binding cause an event within the view model. I have been search for a while and have not come across any solutions that have worked thus far, unfortunately.
This is what I am basically attempting to implement:
<i:Interaction.Triggers>
<i:EventTrigger EventName="createNew">
<cal:ActionMessage MethodName="newCustomer" />
</i:EventTrigger>
</i:Interaction.Triggers>
I am wanting a way to provide a "hotkey" to allow the user to implement a newCustomer event within the view model. So far it won't even reach into the view model. If I attach the EventName="KeyDown" it works wonderfully if any key is pressed, but I am attempting to target a single key.
I will add that the code behind in the view model looks like this.
public void createNew(object sender, KeyEventArgs e)
{ if (e.Key == Key.F9)
{
addCustomer();
} }