1 //*********************************************************
3 // Copyright (c) Microsoft. All rights reserved.
4 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
5 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
6 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
7 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
9 //*********************************************************
12 // SuspensionManager.h
13 // Declaration of the SuspensionManager class
25 /// SuspensionManager captures global session state to simplify process lifetime management
26 /// for an application. Note that session state will be automatically cleared under a variety
27 /// of conditions and should only be used to store information that would be convenient to
28 /// carry across sessions, but that should be disacarded when an application crashes or is
31 ref class SuspensionManager sealed
34 static void RegisterFrame(Windows::UI::Xaml::Controls::Frame^ frame, Platform::String^ sessionStateKey);
35 static void UnregisterFrame(Windows::UI::Xaml::Controls::Frame^ frame);
36 static Concurrency::task<void> SaveAsync(void);
37 static Concurrency::task<void> RestoreAsync(void);
38 static property Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ SessionState
40 Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ get(void);
42 static Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ SessionStateForFrame(
43 Windows::UI::Xaml::Controls::Frame^ frame);
46 static void RestoreFrameNavigationState(Windows::UI::Xaml::Controls::Frame^ frame);
47 static void SaveFrameNavigationState(Windows::UI::Xaml::Controls::Frame^ frame);