diff --git a/src/Calculator/App.xaml b/src/Calculator/App.xaml
index 8a6ab230..b737ea2e 100644
--- a/src/Calculator/App.xaml
+++ b/src/Calculator/App.xaml
@@ -249,7 +249,7 @@
14
16
-
+
diff --git a/src/Calculator/Common/KeyboardShortcutManager.cpp b/src/Calculator/Common/KeyboardShortcutManager.cpp
index 3ce05d15..378db341 100644
--- a/src/Calculator/Common/KeyboardShortcutManager.cpp
+++ b/src/Calculator/Common/KeyboardShortcutManager.cpp
@@ -513,6 +513,12 @@ void KeyboardShortcutManager::OnKeyDownHandler(CoreWindow ^ sender, KeyEventArgs
const auto& lookupMap = GetCurrentKeyDictionary(static_cast(key));
auto buttons = lookupMap.equal_range(static_cast(key));
auto navView = buttons.first->second.Resolve();
+
+ if (navView == nullptr)
+ {
+ return;
+ }
+
auto appViewModel = safe_cast(navView->DataContext);
appViewModel->Mode = ViewMode::Date;
auto categoryName = AppResourceProvider::GetInstance()->GetResourceString(L"DateCalculationModeText");
diff --git a/src/Calculator/Views/MainPage.xaml b/src/Calculator/Views/MainPage.xaml
index 1fc2fddc..ee872121 100644
--- a/src/Calculator/Views/MainPage.xaml
+++ b/src/Calculator/Views/MainPage.xaml
@@ -118,6 +118,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UseSystemFocusVisuals="True"
+ x:Load="False">
@@ -170,41 +214,6 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Calculator/Views/MainPage.xaml.cpp b/src/Calculator/Views/MainPage.xaml.cpp
index 225e992f..0454af69 100644
--- a/src/Calculator/Views/MainPage.xaml.cpp
+++ b/src/Calculator/Views/MainPage.xaml.cpp
@@ -270,12 +270,14 @@ void MainPage::OnPageLoaded(_In_ Object ^, _In_ RoutedEventArgs ^ args)
// Delay load things later when we get a chance.
this->Dispatcher->RunAsync(
- CoreDispatcherPriority::Normal, ref new DispatchedHandler([]() {
+ CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]() {
if (TraceLogger::GetInstance()->IsWindowIdInLog(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread())))
{
AppLifecycleLogger::GetInstance().LaunchUIResponsive();
AppLifecycleLogger::GetInstance().LaunchVisibleComplete();
}
+
+ this->FindName(L"NavView");
}));
}
diff --git a/src/Calculator/Views/MainPage.xaml.h b/src/Calculator/Views/MainPage.xaml.h
index f2c75d6a..2b71bdd6 100644
--- a/src/Calculator/Views/MainPage.xaml.h
+++ b/src/Calculator/Views/MainPage.xaml.h
@@ -1,4 +1,4 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once