Key Down Trigger Behavior

Add a new behavior that listens to a key press event on the associated UIElement and triggers the set of actions.

Platform APIs: KeyDownTriggerBehavior


In this example setting up the KeyDownTriggerBehavior to start the animation:

    PlaceholderText="Set the focus to this TextBox and press enter to trigger the animation"
                <behaviors:StartAnimationAction Animation="{Binding ElementName=MoveAnimation}" />

Sample Project

Key Down Trigger behavior sample page Source. You can see this in action in Windows Community Toolkit Sample App.

Source Code