“WP7”中的问题突然立碑

发布于 2024-11-07 15:18:20 字数 197 浏览 0 评论 0原文

我在 WP7 逻辑删除中遇到一些问题。我的问题是,当我尝试突然建立墓碑并返回时,应用程序挂起。即,加载页面后,我按下设备菜单按钮,并在几秒钟内按下后退按钮(在实际页面消失之前按下后退按钮)在那段时间页面加载,但应用程序挂起/其后退键按下不起作用。如果我们尝试使用慢速墓碑,它会完美地工作。非常有趣的是,在墓碑化 APP 的加载和卸载事件时,它运行得很好。请任何人帮我解决这个问题。

I am facing some issues in WP7 tombstoning. My issue is application hangs when i try for a sudden tombstone and come back. ie, After loading the page i press device menu button and with in seconds i pressed back button( Pressed Back button before the actual page disappeared) In that time the page loads but the application hangs / its back key press is not working. and if we try for a slow thombstone it is working perfectly. And the pretty interesting thing is that, while tombstoning the loaded and unloaded events of APP working perfectly. Please any one help me to solve this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

太阳哥哥 2024-11-14 15:18:20

听起来您的应用程序已被停用,但并未被逻辑删除。这会导致应用程序或页面构造器都不会被调用,从而导致您的应用程序以意外的方式运行。我强烈建议您阅读 Windows Phone Silverlight 应用程序生命周期文档。上述文章的相关摘录:

如果用户
按开始和返回按钮
电话很快接连响起。在这个
案例中,申请收到了
停用事件并且系统已
开始保存状态
应用程序执行应用程序
墓碑。在此操作之前是
完成后,应用程序激活事件为
已收到。系统知道
应用程序未被删除
内存,所以执行流程是
不同的。具体来说:

• 未调用应用程序构造函数。

• 不调用页面构造函数。

应用程序确定的唯一方法
如果发生这种情况
设置一个标志来指示该页面是否
构造函数已被调用。如果你
注意上面的部分,这个标志
在页面构造函数中设置,并且
在 OnNavigateFrom 事件中清除。
在这种情况下,我们将收到
OnNavigedTo 事件,但我们会看到
页面构造函数不是
叫。这告诉我们,我们的
应用程序未墓碑化。

It sounds like your App has been deactivated, but not tombstoned. This results in neither the App or Page contrusctor being called, causing your app to act in unexpected ways. I highly recommend reading the Windows Phone Silverlight Application Life Cycle document. The relevant extract for said article:

This case can occur if the user
presses the Start and Back buttons on
the phone in quick succession. In this
case, the application received a
Deactivate event and the system was
starting to save the state of the
application to perform an application
tombstone. Before this operation is
completed, the app Activated event is
received. The system knows that the
application was not removed from
memory, so the flow of execution is
different. Specifically:

• The app constructor is not called.

• The page constructor is not called.

The only way for the application to determine
if this condition has occurred is to
set a flag to indicate if the page
constructor has been called. If you
notice in the above section, this flag
was set in the page constructor, and
cleared in the OnNavigateFrom event.
In this case, we will receive the
OnNavigatedTo event, but we will see
that the page constructor was not
called. This tells us that our
application was not tombstoned.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文