问题标签 [tombstoning]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
225 浏览

xaml - 在 Windows Store Xaml 应用程序中保存通用列表

我正在尝试为 Windows 商店开发 xaml 应用程序。在开发过程中,我遇到了一个问题。我想将对象的通用列表保存到本地存储,但每次我尝试保存列表时,它都会触发“类型不支持”的异常。

任何人都可以帮助我在 Windows 8 应用程序的本地商店中保存和恢复通用列表。

0 投票
1 回答
184 浏览

serialization - Windows Phone - 墓碑的序列化

我正在寻找适用于 Windows Phone 8 的序列化程序。DataContractSerializer 对我不起作用,因为数据成员需要是公共的,并且它们需要公共设置器。

我不需要用于墓碑的庞大库,我认为智能序列化程序适合我。如果序列化程序返回一个可以存储到 PhoneApplicationPage.State 中的序列化字符串会很好,因为我不想使用独立存储。

0 投票
0 回答
82 浏览

windows-phone-8 - 在应用程序进入挂起状态之前更改最后一页 (WP8)

当用户按下并按住返回按钮(或按下 Win btn)时,应用程序被停用并显示应用程序切换器。问题是应用程序的最后一页在应用程序切换器中不可见,因为存在敏感数据。如何在应用程序进入挂起状态之前隐藏最后一页的内容或导航到其他页面?

0 投票
1 回答
95 浏览

c# - 墓碑在 wp8 上不起作用

我正在构建一个 MVVM Windows Phone 8 应用程序。

我读了这篇文章试图解决墓碑问题:http ://www.scottlogic.com/blog/2011/10/03/a-windows-phone-7-1-mango-mvvm-tombstoning-example.html

此示例在 MVVM 应用程序上实现 Tombstonning。该应用程序在列表框中生成一个 twitter 提要。

我在处理旧的 twitter api 时更改了这个示例的一些代码行,但是当我运行应用程序时,关闭它或激活 Win 或 Search 按钮,然后重新启动它,页面状态不一样。

这是我在视图模型中更改以模拟新的 Twitter 提要:

但是当我关闭我的应用程序并重新启动它时,状态并不相同,例如滚动条位置与我离开应用程序时的位置不同,尽管此示例中有一个方法可以记住列表的滚动位置。

你知道为什么墓碑不能正常工作吗?

0 投票
1 回答
157 浏览

c# - 在 Windows Phone 8 上建立一个列表

我正在尝试在 wp 上保存列表框的状态。我用这个方法来墓碑文本框的内容,它工作得很好,但我遇到了字符串列表的问题:

基本上我有一个名为 beta 的字符串列表,我必须单击一个按钮来生成列表。所以我希望如果我关闭或停用我的应用程序然后重新启动它,列表就会显示而无需按下按钮

但出现问题:

尽管此方法适用于一个字符串,但不适用于列表。

我应该对字符串列表使用哪种方法?

编辑 :

以下是我在应用程序关闭、停用、启动或打开时调用的 app.xaml.cs 类中的方法:

正如我之前所说,此方法适用于在文本框中正确恢复的字符串,但不适用于字符串列表

0 投票
2 回答
228 浏览

c# - Rendering a WriteableBitmap within Application_Deactivated event causes app to fail to re-activate after suspension

I am building a Windows Phone 8 version of an app that I already have for Windows Phone 7.1, which works perfectly. Inside the Application_Deactivated event (in App.xaml.cs) I attempt to update the secondary tile of my app, if pinned to the start screen. Because it is a custom tile, I build it in code using a grid and by adding elements to it. So in the final step, I have something like (layoutRoot is of type Grid) :

#xA;

So then I can update the Tile very easily. The problem is that when the app is running and I tap the "Windows" button, the app is successfully suspended and the Tile updated, but when I hit "back" to make it active again, a default "loading" text is shown on screen and nothing will happen. However, I have noticed that by commenting out the line bitmap.Render(layoutRoot, null);, the app is re-activated successfully and it works fine, despite the fact that the Tile does not get updated upon suspension, as expected.

In the WP7.1 version of the app, this never happens, although the method for updating the Tile is the same. I really cannot figure out what is going on. Any comment/suggestion/advice will be appreciated.

Edit. Aplication_Deactivated code:

#xA;
0 投票
0 回答
279 浏览

c# - MvvmCross Windows Store App - 测试挂起/恢复(墓碑)

我正在尝试在基于 mvvmcross 的 C# Store 应用程序中测试“墓碑”。我的代码基于Stuart 的指令

无论我在本地机器或模拟器中做什么,都不会调用“ReloadState”。调试器运行时有什么方法可以触发暂停?人们如何测试这个功能?

0 投票
3 回答
106 浏览

c# - How to save a coordinate list after app is tombstoned?

I have a list of coordinates saved in a map class that are manipulated to draw a route between the points, but I'm not sure how to save these points when the application is closed and then reopened.

This is how I currently save the points within the app in the OnNavigatedTo(), the points and markers aren't lost as long as I don't close it. But how do I save these coordinates after I close the app?

I'm guessing I should save them in the OnNavigatedFrom but I tried saving the coordinate list here and the markers don't show when I repopen the app.

0 投票
2 回答
90 浏览

windows-phone - WinPhone 应用程序事件对应用程序进程终止作出反应

当我们停用 WP 应用程序时,它可能会被 OS 删除并在以后终止。当进程终止时,我需要将一些未保存的应用程序数据保存到持久存储中,但在此之前不需要。显然,Deactivated 事件不能用于此目的,因为它会在应用程序移至后台时立即引发;Close 事件也不是我们需要的事件,因为它不会在应用程序进程被操作系统终止时引发。是否有一个特殊的 Windows Phone 应用程序事件,比如 Application_Terminated?

0 投票
1 回答
326 浏览

silverlight - NavigationContext.QueryString 在 WP8 Silverlight 页面应用程序中的墓碑后未清除

让我们考虑一个两页的 Silverlight WP 应用程序:主页面 PageA,以及另一个可以从 PageA 打开并向其中传递参数的 PageB。正如 Charles Petzold 在他的畅销书“Programming WP7”中所建议的那样,我们可以使用如下语句来实例化 PageB:

然后在PageB的OnNavigatedTo/OnNaviagetdFrom事件中使用如下构造处理参数和应用被墓碑重新激活时的情况:

但是,如果用户从 PageB 离开应用程序,我们会遇到一个问题,该应用程序被删除,并且用户使用任务管理器再次返回到同一个 PageB 的应用程序。在这种情况下,NavigationContext.QueryString在 OnNavigatedTo 事件中返回相同的 ItemIndex 参数,就好像页面是从 PageA 调用的,而第二个 'if' 永远不会执行!

我是否错过了一些重要的事情(应用程序设置等),或者 WP8 中的行为发生了变化,我们不能再使用这种方法?