From 695b82d2f1b905c3643d7f8de3146220d9725afa Mon Sep 17 00:00:00 2001 From: Matt Cooley Date: Fri, 1 Feb 2019 13:36:57 -0800 Subject: [PATCH] Delete LayoutAwarePage --- src/Calculator/Calculator.vcxproj | 2 - src/Calculator/Calculator.vcxproj.filters | 6 -- src/Calculator/Common/LayoutAwarePage.cpp | 82 ----------------------- src/Calculator/Common/LayoutAwarePage.h | 29 -------- src/Calculator/Views/MainPage.xaml | 36 +++++----- src/Calculator/Views/MainPage.xaml.h | 1 - 6 files changed, 18 insertions(+), 138 deletions(-) delete mode 100644 src/Calculator/Common/LayoutAwarePage.cpp delete mode 100644 src/Calculator/Common/LayoutAwarePage.h diff --git a/src/Calculator/Calculator.vcxproj b/src/Calculator/Calculator.vcxproj index 59cb8e67..cfa37198 100644 --- a/src/Calculator/Calculator.vcxproj +++ b/src/Calculator/Calculator.vcxproj @@ -219,7 +219,6 @@ - @@ -354,7 +353,6 @@ - diff --git a/src/Calculator/Calculator.vcxproj.filters b/src/Calculator/Calculator.vcxproj.filters index 87bc5ea9..c702af96 100644 --- a/src/Calculator/Calculator.vcxproj.filters +++ b/src/Calculator/Calculator.vcxproj.filters @@ -231,9 +231,6 @@ Common - - Common - Controls @@ -324,9 +321,6 @@ Common - - Common - Controls diff --git a/src/Calculator/Common/LayoutAwarePage.cpp b/src/Calculator/Common/LayoutAwarePage.cpp deleted file mode 100644 index d4b904e3..00000000 --- a/src/Calculator/Common/LayoutAwarePage.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include "pch.h" -#include "LayoutAwarePage.h" -#include "CalcViewModel\Common\LocalizationService.h" -#include "App.xaml.h" - -using namespace CalculatorApp::Common; - -using namespace Platform; -using namespace Platform::Collections; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::System; -using namespace Windows::UI::Core; -using namespace Windows::UI::ViewManagement; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Interop; -using namespace Windows::UI::Xaml::Navigation; - -/// -/// Initializes a new instance of the class. -/// -LayoutAwarePage::LayoutAwarePage() -{ - if (Windows::ApplicationModel::DesignMode::DesignModeEnabled) - { - return; - } - - Language = LocalizationService::GetInstance()->GetLanguage(); -} - -#pragma region Process lifetime management - -/// -/// Invoked when this page is about to be displayed in a Frame. -/// -/// Event data that describes how this page was reached. The Parameter -/// property provides the group to be displayed. -void LayoutAwarePage::OnNavigatedTo(NavigationEventArgs^ e) -{ - LoadState(e->Parameter, nullptr); -} - -/// -/// Invoked when this page will no longer be displayed in a Frame. -/// -/// Event data that describes how this page was reached. The Parameter -/// property provides the group to be displayed. -void LayoutAwarePage::OnNavigatedFrom(NavigationEventArgs^ e) -{ - auto pageState = ref new Map(); - SaveState(pageState); -} - -/// -/// Populates the page with content passed during navigation. Any saved state is also -/// provided when recreating a page from a prior session. -/// -/// The parameter value passed to -/// when this page was initially requested. -/// -/// A map of state preserved by this page during an earlier -/// session. This will be null the first time a page is visited. -void LayoutAwarePage::LoadState(Object^ navigationParameter, IMap^ pageState) -{ -} - -/// -/// Preserves state associated with this page in case the application is suspended or the -/// page is discarded from the navigation cache. Values must conform to the serialization -/// requirements of . -/// -/// An empty map to be populated with serializable state. -void LayoutAwarePage::SaveState(IMap^ pageState) -{ -} - -#pragma endregion diff --git a/src/Calculator/Common/LayoutAwarePage.h b/src/Calculator/Common/LayoutAwarePage.h deleted file mode 100644 index c62559aa..00000000 --- a/src/Calculator/Common/LayoutAwarePage.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -#include - -namespace CalculatorApp -{ - namespace Common - { - [Windows::Foundation::Metadata::WebHostHidden] - public ref class LayoutAwarePage : Windows::UI::Xaml::Controls::Page - { - internal: - LayoutAwarePage(); - - protected: - virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; - virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; - virtual void LoadState(Platform::Object^ navigationParameter, - Windows::Foundation::Collections::IMap^ pageState); - virtual void SaveState(Windows::Foundation::Collections::IMap^ pageState); - - private: - Platform::String^ _pageKey; - }; - } -} diff --git a/src/Calculator/Views/MainPage.xaml b/src/Calculator/Views/MainPage.xaml index e8a1d831..6136f42f 100644 --- a/src/Calculator/Views/MainPage.xaml +++ b/src/Calculator/Views/MainPage.xaml @@ -1,20 +1,20 @@ - + @@ -160,4 +160,4 @@ - + diff --git a/src/Calculator/Views/MainPage.xaml.h b/src/Calculator/Views/MainPage.xaml.h index 82453dae..d0218878 100644 --- a/src/Calculator/Views/MainPage.xaml.h +++ b/src/Calculator/Views/MainPage.xaml.h @@ -3,7 +3,6 @@ #pragma once -#include "Common\LayoutAwarePage.h" // Required by generated header #include "Views\Calculator.xaml.h" #include "Views\MainPage.g.h" #include "Views\DateCalculator.xaml.h"