WPF XAML apps have had an IsDefault
property for buttons so the Enter
key will click a particular button by default. How can we do this in a Windows Run Time application?
<Button Name="SubmitButton" Content="Enter" />
WPF XAML apps have had an IsDefault
property for buttons so the Enter
key will click a particular button by default. How can we do this in a Windows Run Time application?
<Button Name="SubmitButton" Content="Enter" />
You'll need to generate this yourself unfortunately, there is no built in property. Subscribe to the keydown event on the parent control and listen for the enter key to be hit, then execute your event.
if (e.Key == Windows.System.VirtualKey.Enter)
{
}