XAML ALT+letter to focus textbox

If you want the user to be able to focus a specific field with an ALT+Key – eg. ALT+F, you can do it the following way:

&lt;Label Target=&quot;{Binding ElementName=Username}&quot;&gt;Enter _Username:&lt;/Label&gt;<br />
&lt;TextBox<br />
Name=&quot;UserName&quot;<br />
Text=&quot;{Binding Username, Mode=TwoWay, UpdateSourceTrigger=LostFocus}&quot;&gt;<br />

  • Target of Label associates it with the TextBox.
  • Underscore _Before a letter makes it accessible via the ALT+Key

If you are from the Web World, you are used to associating labels with inputs via the ID-attribute. Target looks similar.