从NavigationState清除扩展的启动画面。不能使用Frame.GetNavigationState()? [英] Clear Extended Splash Screen from NavigationState. Cannot use Frame.GetNavigationState() ?

查看:114
本文介绍了从NavigationState清除扩展的启动画面。不能使用Frame.GetNavigationState()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是这篇文章的延续:

http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/ce818798-6395- 483b-9f7f-3e31273e832d

其中 显示如何在异步调用后添加扩展的启动画面并自动导航。 (由于某种原因,它实际上并没有等待我们的虚拟异步调用中指定的10秒,但希望这并不重要)

Which shows how to add an extended splash screen and automate navigation after an asynchronous call. ( For some reason it doesn't actually wait for the 10 seconds specified in our dummy async call, but hopefully that's not critical )

现在的问题是有导航甚至添加"扩展的闪屏"到Back堆栈并允许用户尝试导航回扩展的启动屏幕,在加载时立即导航到同一页面并创建
循环。我们基本上让用户永远无法通过从导航堆栈中删除它来导航到扩展的启动画面。

The problem now is that there is a navigation even which adds the "extended splash screen" to the Back stack and allows the user to attempt to navigate back to the extended splash screen which upon loading immediate navigates to the same page and creates a loop. We basically wan the user to never be able to navigate to the extended splash screen by erasing it from the navigation stack.

如果我是的话,我找不到清除导航历史的好解决方案从ExtendedSplashScreen转到GroupedItemsPage。

I cannot find a good solution to clear the navigation history if I'm coming to the GroupedItemsPage from the ExtendedSplashScreen.

我已阅读这些相关帖子:

I have read these related posts:

参考文献1:

http://social.msdn.microsoft.com /论坛/ zh-CN / winappswithcsharp / thread / 3791fc7d-2f94-41b8-9f06-644813265751

这个建议不要使用Frames导航,以便它不会自动添加导航状态;但是,我们需要App.xaml.cs上的Frames注册到SessionManager等,使用它们来传递参数并保持一致的
导航是有意义的。所以我更喜欢使用框架的解决方案,但只是认识到我们来自扩展的启动画面并清除导航。

This one suggests not to use Frames to navigate so that it doesn't automatically add navigation states; however, we needed Frames on the App.xaml.cs to register to the SessionManager, etc and it makes sense to use them to pass parameters and keep consistent navigation. So I would prefer a solution which uses frames but just recognizes that we came from an extended splash screen and clears the navigation.

参考2:

http://social.msdn.microsoft.com/论坛/ zh-CN / winappswithcsharp / thread / cf7c987b-bb9f-4293-9e06-81c05a8ea907

这个建议使用Frame.GetNavigationState()来存储导航状态到ExtendedSplashScreen上的本地字符串,然后将其作为参数传递给GroupedItemsPage,然后使用Frame.SetNavigationState((string)navigationParam
)恢复状态。

This one suggests to manipulate the Navigation state using Frame.GetNavigationState() to store into a local string on ExtendedSplashScreen then pass it as a parameter to the GroupedItemsPage which will then use Frame.SetNavigationState( (string)navigationParam ) to restore the state.

我试过实现此建议并收到错误:" WinRT信息:GetNavigationState不支持传递给Frame.Navigate的参数类型的序列化。其他信息:未指定的错误"所以这里
我正在寻求帮助。

I tried to implement this suggestion and was receiving an error: "WinRT information: GetNavigationState doesn't support serialization of a parameter type which was passed to Frame.Navigate. Additional information: Unspecified error" So here I am asking for help.

要么如何解决序列化问题,要么是从导航堆栈中删除扩展启动画面的另一种方法。& nbsp ;我需要"SplashScreen"和"SplashScreen"。要传递给扩展的初始屏幕的对象,以便定位图像,所以
我无法摆脱它。

Either how do I get around the serialization issue or what is another way to remove the extended splash screen from navigation stack.  I need the "SplashScreen" object to be passed to the extended splash screen in order to position the image so I can't get rid of that.

我已经给了一个工作扩展启动的链接屏幕项目与该行:

I have given a link to a working extended splash screen project with the line:

http://sdrv.ms/LEsg5T

currentNavigationState  = Frame.GetNavigationState();

currentNavigationState  = Frame.GetNavigationState();

如果您取消注释并重新运行,您将看到错误。 我希望以某种方式将参数AllGroups与序列化字符串组合为一个参数,然后将它们拆分为GroupedItemsPage并在那里处理。

if you uncomment it, and re-run, you will see the error.  I was hoping to somehow combine the parameter AllGroups with the serialized string as one parameter and then split them on GroupedItemsPage and process there.

-Matt

推荐答案

我会尽快看看这个。


这篇关于从NavigationState清除扩展的启动画面。不能使用Frame.GetNavigationState()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆