Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.57 KB

FocusBehaviors.md

File metadata and controls

41 lines (28 loc) · 1.57 KB
title author description keywords dev_langs
Focus Behaviors
michael-hawker
Behaviors for helping focus controls in different scenarios.
windows 10, uwp, windows community toolkit, uwp community toolkit, uwp toolkit, textbox, behaviors, interactivity, focus, auto focus
csharp

Focus Behaviors

The FocusBehavior and AutoFocusBehavior help control focus flow within your application.

Platform APIs: AutoFocusBehavior, FocusBehavior

[!div class="nextstepaction"] Try it in the sample app

Example

In this example using the AutoFocusBehavior the button will automatically receive focus when it is loaded:

  <Button Content="I receive the focus when loaded">
    <interactivity:Interaction.Behaviors>
      <behaviors:AutoFocusBehavior />
    </interactivity:Interaction.Behaviors>
  </Button>

Sample Project

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

Source Code

Related Topics