Handle Space and Enter KeyDown event for About button (#1459)
This commit is contained in:
parent
cdcb95656d
commit
f910d64d88
@ -177,6 +177,7 @@
|
|||||||
<muxc:NavigationViewItem x:Name="AboutButton"
|
<muxc:NavigationViewItem x:Name="AboutButton"
|
||||||
x:Uid="AboutButton"
|
x:Uid="AboutButton"
|
||||||
Style="{StaticResource NavViewItemStyle}"
|
Style="{StaticResource NavViewItemStyle}"
|
||||||
|
KeyDown="OnAboutButtonKeyDown"
|
||||||
Tapped="OnAboutButtonClick">
|
Tapped="OnAboutButtonClick">
|
||||||
<muxc:NavigationViewItem.Icon>
|
<muxc:NavigationViewItem.Icon>
|
||||||
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}" Glyph=""/>
|
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}" Glyph=""/>
|
||||||
|
@ -432,6 +432,14 @@ void MainPage::OnAboutButtonClick(Object ^ sender, ItemClickEventArgs ^ e)
|
|||||||
ShowAboutPage();
|
ShowAboutPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainPage::OnAboutButtonKeyDown(Object ^ sender, KeyRoutedEventArgs ^ e)
|
||||||
|
{
|
||||||
|
if (e->Key == VirtualKey::Space || e->Key == VirtualKey::Enter)
|
||||||
|
{
|
||||||
|
ShowAboutPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainPage::OnAboutFlyoutOpened(_In_ Object ^ sender, _In_ Object ^ e)
|
void MainPage::OnAboutFlyoutOpened(_In_ Object ^ sender, _In_ Object ^ e)
|
||||||
{
|
{
|
||||||
// Keep Ignoring Escape till the About page flyout is opened
|
// Keep Ignoring Escape till the About page flyout is opened
|
||||||
|
@ -55,6 +55,7 @@ public
|
|||||||
_In_ Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs ^ e);
|
_In_ Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs ^ e);
|
||||||
|
|
||||||
void OnAboutButtonClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Controls::ItemClickEventArgs ^ e);
|
void OnAboutButtonClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Controls::ItemClickEventArgs ^ e);
|
||||||
|
void OnAboutButtonKeyDown(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e);
|
||||||
void OnAboutFlyoutOpened(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
|
void OnAboutFlyoutOpened(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
|
||||||
void OnAboutFlyoutClosed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
|
void OnAboutFlyoutClosed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
|
||||||
void AlwaysOnTopButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void AlwaysOnTopButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
|
Loading…
Reference in New Issue
Block a user