mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Fix to this issue: Clicking on the same element in the hamburger view should re-open that view, like the menu items do #437
This commit is contained in:
parent
af41a183a7
commit
bd22807420
3 changed files with 17 additions and 0 deletions
|
@ -109,6 +109,7 @@
|
||||||
PaneOpened="OnNavPaneOpened"
|
PaneOpened="OnNavPaneOpened"
|
||||||
PaneOpening="OnNavPaneOpening"
|
PaneOpening="OnNavPaneOpening"
|
||||||
SelectionChanged="OnNavSelectionChanged"
|
SelectionChanged="OnNavSelectionChanged"
|
||||||
|
ItemInvoked="OnNavItemInvoked"
|
||||||
TabIndex="1"
|
TabIndex="1"
|
||||||
UseSystemFocusVisuals="True">
|
UseSystemFocusVisuals="True">
|
||||||
<muxc:NavigationView.PaneFooter>
|
<muxc:NavigationView.PaneFooter>
|
||||||
|
|
|
@ -601,3 +601,17 @@ void MainPage::AnnounceCategoryName()
|
||||||
NarratorAnnouncement^ announcement = CalculatorAnnouncement::GetCategoryNameChangedAnnouncement(categoryName);
|
NarratorAnnouncement^ announcement = CalculatorAnnouncement::GetCategoryNameChangedAnnouncement(categoryName);
|
||||||
NarratorNotifier->Announce(announcement);
|
NarratorNotifier->Announce(announcement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainPage::OnNavItemInvoked(_In_ Microsoft::UI::Xaml::Controls::NavigationView^ sender, _In_ Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs^ e)
|
||||||
|
{
|
||||||
|
auto item = dynamic_cast<MUXC::NavigationViewItem^>(e->InvokedItemContainer);
|
||||||
|
if (item != nullptr)
|
||||||
|
{
|
||||||
|
auto selectedItem = static_cast<NavCategory^>(item->DataContext);
|
||||||
|
|
||||||
|
if (selectedItem->Mode == Model->Mode)
|
||||||
|
{
|
||||||
|
NavView->IsPaneOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -52,6 +52,8 @@ namespace CalculatorApp
|
||||||
void OnNavPaneOpened(_In_ Microsoft::UI::Xaml::Controls::NavigationView^ sender, _In_ Platform::Object^ args);
|
void OnNavPaneOpened(_In_ Microsoft::UI::Xaml::Controls::NavigationView^ sender, _In_ Platform::Object^ args);
|
||||||
void OnNavPaneClosed(_In_ Microsoft::UI::Xaml::Controls::NavigationView^ sender, _In_ Platform::Object^ args);
|
void OnNavPaneClosed(_In_ Microsoft::UI::Xaml::Controls::NavigationView^ sender, _In_ Platform::Object^ args);
|
||||||
void OnNavSelectionChanged(_In_ Platform::Object^ sender, _In_ Microsoft::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs^ e);
|
void OnNavSelectionChanged(_In_ Platform::Object^ sender, _In_ Microsoft::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs^ e);
|
||||||
|
void OnNavItemInvoked(_In_ Microsoft::UI::Xaml::Controls::NavigationView^ sender, _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 OnAboutFlyoutOpened(_In_ Platform::Object^ sender, _In_ Platform::Object^ e);
|
void OnAboutFlyoutOpened(_In_ Platform::Object^ sender, _In_ Platform::Object^ e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue