mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 22:03:11 -07:00
Delete LayoutAwarePage
This commit is contained in:
parent
f298662fb3
commit
695b82d2f1
6 changed files with 18 additions and 138 deletions
|
@ -219,7 +219,6 @@
|
||||||
<ClInclude Include="Controls\OverflowTextBlockAutomationPeer.h" />
|
<ClInclude Include="Controls\OverflowTextBlockAutomationPeer.h" />
|
||||||
<ClInclude Include="Common\AlwaysSelectedCollectionView.h" />
|
<ClInclude Include="Common\AlwaysSelectedCollectionView.h" />
|
||||||
<ClInclude Include="Common\BindableBase.h" />
|
<ClInclude Include="Common\BindableBase.h" />
|
||||||
<ClInclude Include="Common\LayoutAwarePage.h" />
|
|
||||||
<ClInclude Include="Controls\AppBar.h" />
|
<ClInclude Include="Controls\AppBar.h" />
|
||||||
<ClInclude Include="Controls\CalculationResult.h" />
|
<ClInclude Include="Controls\CalculationResult.h" />
|
||||||
<ClInclude Include="Controls\CalculatorButton.h" />
|
<ClInclude Include="Controls\CalculatorButton.h" />
|
||||||
|
@ -354,7 +353,6 @@
|
||||||
<ClCompile Include="Controls\CalculationResultAutomationPeer.cpp" />
|
<ClCompile Include="Controls\CalculationResultAutomationPeer.cpp" />
|
||||||
<ClCompile Include="Controls\OverflowTextBlockAutomationPeer.cpp" />
|
<ClCompile Include="Controls\OverflowTextBlockAutomationPeer.cpp" />
|
||||||
<ClCompile Include="Common\BindableBase.cpp" />
|
<ClCompile Include="Common\BindableBase.cpp" />
|
||||||
<ClCompile Include="Common\LayoutAwarePage.cpp" />
|
|
||||||
<ClCompile Include="Controls\CalculationResult.cpp" />
|
<ClCompile Include="Controls\CalculationResult.cpp" />
|
||||||
<ClCompile Include="Controls\CalculatorButton.cpp" />
|
<ClCompile Include="Controls\CalculatorButton.cpp" />
|
||||||
<ClCompile Include="Controls\FlipButtons.cpp" />
|
<ClCompile Include="Controls\FlipButtons.cpp" />
|
||||||
|
|
|
@ -231,9 +231,6 @@
|
||||||
<ClCompile Include="Common\BindableBase.cpp">
|
<ClCompile Include="Common\BindableBase.cpp">
|
||||||
<Filter>Common</Filter>
|
<Filter>Common</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Common\LayoutAwarePage.cpp">
|
|
||||||
<Filter>Common</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Controls\CalculationResult.cpp">
|
<ClCompile Include="Controls\CalculationResult.cpp">
|
||||||
<Filter>Controls</Filter>
|
<Filter>Controls</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -324,9 +321,6 @@
|
||||||
<ClInclude Include="Common\BindableBase.h">
|
<ClInclude Include="Common\BindableBase.h">
|
||||||
<Filter>Common</Filter>
|
<Filter>Common</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Common\LayoutAwarePage.h">
|
|
||||||
<Filter>Common</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Controls\AppBar.h">
|
<ClInclude Include="Controls\AppBar.h">
|
||||||
<Filter>Controls</Filter>
|
<Filter>Controls</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -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;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="LayoutAwarePage"/> class.
|
|
||||||
/// </summary>
|
|
||||||
LayoutAwarePage::LayoutAwarePage()
|
|
||||||
{
|
|
||||||
if (Windows::ApplicationModel::DesignMode::DesignModeEnabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Language = LocalizationService::GetInstance()->GetLanguage();
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma region Process lifetime management
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoked when this page is about to be displayed in a Frame.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">Event data that describes how this page was reached. The Parameter
|
|
||||||
/// property provides the group to be displayed.</param>
|
|
||||||
void LayoutAwarePage::OnNavigatedTo(NavigationEventArgs^ e)
|
|
||||||
{
|
|
||||||
LoadState(e->Parameter, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoked when this page will no longer be displayed in a Frame.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">Event data that describes how this page was reached. The Parameter
|
|
||||||
/// property provides the group to be displayed.</param>
|
|
||||||
void LayoutAwarePage::OnNavigatedFrom(NavigationEventArgs^ e)
|
|
||||||
{
|
|
||||||
auto pageState = ref new Map<String^, Object^>();
|
|
||||||
SaveState(pageState);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Populates the page with content passed during navigation. Any saved state is also
|
|
||||||
/// provided when recreating a page from a prior session.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="navigationParameter">The parameter value passed to
|
|
||||||
/// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested.
|
|
||||||
/// </param>
|
|
||||||
/// <param name="pageState">A map of state preserved by this page during an earlier
|
|
||||||
/// session. This will be null the first time a page is visited.</param>
|
|
||||||
void LayoutAwarePage::LoadState(Object^ navigationParameter, IMap<String^, Object^>^ pageState)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 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 <see cref="SuspensionManager.SessionState"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageState">An empty map to be populated with serializable state.</param>
|
|
||||||
void LayoutAwarePage::SaveState(IMap<String^, Object^>^ pageState)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma endregion
|
|
|
@ -1,29 +0,0 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
// Licensed under the MIT License.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <collection.h>
|
|
||||||
|
|
||||||
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<Platform::String^, Platform::Object^>^ pageState);
|
|
||||||
virtual void SaveState(Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ pageState);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Platform::String^ _pageKey;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
<common:LayoutAwarePage x:Class="CalculatorApp.MainPage"
|
<Page x:Class="CalculatorApp.MainPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:automation="using:CalculatorApp.Common.Automation"
|
xmlns:automation="using:CalculatorApp.Common.Automation"
|
||||||
|
@ -160,4 +160,4 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
</muxc:NavigationView>
|
</muxc:NavigationView>
|
||||||
</Grid>
|
</Grid>
|
||||||
</common:LayoutAwarePage>
|
</Page>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Common\LayoutAwarePage.h" // Required by generated header
|
|
||||||
#include "Views\Calculator.xaml.h"
|
#include "Views\Calculator.xaml.h"
|
||||||
#include "Views\MainPage.g.h"
|
#include "Views\MainPage.g.h"
|
||||||
#include "Views\DateCalculator.xaml.h"
|
#include "Views\DateCalculator.xaml.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue