From 52ad2063bd76a56a6e905bba969e93123600d34f Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 4 Jun 2014 11:19:53 +0800 Subject: [PATCH 1/2] Support Fast App Resume. --- .../proj.wp8-xaml/HelloCpp/Properties/WMAppManifest.xml | 2 +- .../proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml | 2 +- .../proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/Properties/WMAppManifest.xml b/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/Properties/WMAppManifest.xml index 92867a47d9..8437827d62 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/Properties/WMAppManifest.xml +++ b/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/Properties/WMAppManifest.xml @@ -11,7 +11,7 @@ - + diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml index e980dc34e6..e2147a3eeb 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Properties/WMAppManifest.xml @@ -11,7 +11,7 @@ - + diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml index c9f4413365..33ee5c4b57 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Properties/WMAppManifest.xml @@ -11,7 +11,7 @@ - + From 3fcb75c82f711a6b4ecdbc1be657eac9c9209cf1 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 4 Jun 2014 13:54:44 +0800 Subject: [PATCH 2/2] Fixed black screen may arise when using third SDK. --- .../proj.wp8-xaml/HelloCpp/App.xaml.cs | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/App.xaml.cs b/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/App.xaml.cs index 1269fb1137..ce05496656 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/App.xaml.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/HelloCpp/App.xaml.cs @@ -140,12 +140,36 @@ namespace PhoneDirect3DXamlAppInterop RootFrame.Navigated -= CompleteInitializePhoneApplication; } + private bool _isResume = false; private void CheckForResetNavigation(object sender, NavigationEventArgs e) { - // If the app has received a 'reset' navigation, then we need to check - // on the next navigation to see if the page stack should be reset if (e.NavigationMode == NavigationMode.Reset) + { + RootFrame.Navigating += HandlerFotResetNavigating; + _isResume = true; + } + else + { + if (_isResume && e.NavigationMode == NavigationMode.Refresh) + { + RootFrame.Navigating -= HandlerFotResetNavigating; + _isResume = false; + } + } + } + + private void HandlerFotResetNavigating(object sender, NavigatingCancelEventArgs e) + { + RootFrame.Navigating -= HandlerFotResetNavigating; + if (e.Uri.OriginalString.Contains("MainPage.xaml")) + { + e.Cancel = true; + } + else + { RootFrame.Navigated += ClearBackStackAfterReset; + } + _isResume = false; } private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)