FocusOnKeyPress

Sometimes you need to handle a key press and then set the focus on an element.

  1. Add the following XML namespaces:
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:catel="http://schemas.catelproject.com"
  1. Use the following definition:
<TextBox x:Name="textBox">
    <i:Interaction.Behaviors>
        <catel:FocusOnKeyPress Key="F" Modifiers="Ctrl" />
    </i:Interaction.Behaviors>
</ListBox>

Contributions

We would like to thank the following contributors:

Want to contribute to the documentation? We have a guide for that!


Questions

Have a question about Catel? Use StackOverflow with the Catel tag!