Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It sounds like you're looking for a "codeless" MVVMish way of handling the KeyUp/KeyPress/KeyDown event.</p> <p><strong>Option #1: Prism.</strong><br> You've mentioned it only <strong>ships</strong> with the Click command. However, you can add your own attached DPs to enable commands for whatever event you'd like (like KeyUp/KeyDown/KeyPress). </p> <p>If you're looking for a sample on that Corey has a good one for ToggleButton.Checked/Unchecked events.<br> <a href="http://www.85turns.com/2009/06/24/togglebutton-command-for-prism/" rel="noreferrer">http://www.85turns.com/2009/06/24/togglebutton-command-for-prism/</a> </p> <pre><code>&lt;ToggleButton x:Name="ToggleButton1" customCommands:Checked.Command="{Binding CheckedCommand}" customCommands:UnChecked.Command="{Binding UnCheckedCommand}" Margin="8,8,0,8" Content="Check me" /&gt; </code></pre> <p>Also, Erik Mork has an excellent video that gives you a good overview on commands and how to create a custom command Attached DP. <a href="http://development-guides.silverbaylabs.org/Video/Prism-Commands" rel="noreferrer">http://development-guides.silverbaylabs.org/Video/Prism-Commands</a></p> <p><strong>Option #2: Blend Triggers</strong><br> The Expression Blend SDK ships with Triggers and Behaviours that are spot on to what you're try to do.<br> <a href="http://expressionblend.codeplex.com/" rel="noreferrer">Blend Examples</a> codeplex project ships with a EventTrigger you could use: </p> <pre><code>&lt;i:EventTrigger EventName="Click"&gt; &lt;si:InvokeDataCommand Command="{Binding ShoppingCart.CheckOutCommand}"/&gt; &lt;/i:EventTrigger&gt; </code></pre> <p>Or, you could create your own custom Trigger for Key stroke events and do there whatever you'd like. Here's a sample:<br> <a href="http://azurecoding.net/blogs/brownie/archive/2009/04/06/blend-behaviors-ftw.aspx" rel="noreferrer">http://azurecoding.net/blogs/brownie/archive/2009/04/06/blend-behaviors-ftw.aspx</a> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload