c# - Using EventTrigger to call a specific key -


i have eventtrigger calls keydown event, , uses trigger call viewmodel command using eventtocommand. best way specify key used in keydown event (apart passing keyeventargs through commandparameter using passeventargstocommand)?

example:

<i:interaction.triggers>     <i:eventtrigger eventname="keydown">         <command:eventtocommand command="{binding path=testcommand}"                                 commandparameter="{binding elementname=templistview,                                                            path=selecteditem}" />      </i:eventtrigger> </i:interaction.triggers> 

any on appreciated.

you can bind 1 element using command parameter, if need key event data use

<i:interaction.triggers>     <i:eventtrigger eventname="keydown">         <command:eventtocommand command="{binding path=testcommand}"  passeventargstocommand="true"/>      </i:eventtrigger> </i:interaction.triggers>  public relaycommand<keyeventargs> command { get; private set; } 

or if using listbox example , want item, should it:

 <i:interaction.triggers>         <i:eventtrigger eventname="keydown">               <command:eventtocommand command="{binding path=testcommand}"  commandparameter="{binding}"/>          </i:eventtrigger>     </i:interaction.triggers> 

if need key and item, that's bit more trickier, on binded collection can maybe combine use of described trigger binded selecteditem, when command if fired can check selected item on viewmodel.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -