如何在升级后停止动态磁贴计划

发布于 2024-12-22 21:58:52 字数 976 浏览 2 评论 0原文

我有一个 Windows Phone 7 应用程序,当前使用动态磁贴计划进行更新。

新版本的应用程序使用后台任务来更新图块。

但是,在手机上升级应用程序后,如果磁贴计划已在主磁贴上运行,则它不会停止更新。

如果瓷砖计划正在运行,我需要停止它。

创建新计划并停止它不起作用:

var t = new ShellTileSchedule()
                {
                    MaxUpdateCount = 1,
                    Recurrence = UpdateRecurrence.Onetime,
                    StartTime = DateTime.Now,
                    RemoteImageUri = new Uri("http://mysite.com/livetile.png"),
                };
t.Start();
t.Stop();

在活动磁贴中的主磁贴上创建新计划不起作用:

ShellTile mainTile = ShellTile.ActiveTiles.FirstOrDefault();
t = new ShellTileSchedule(mainTile)
                    {
                        MaxUpdateCount = 1,
                        Recurrence = UpdateRecurrence.Onetime,
                        StartTime = DateTime.Now,
                        RemoteImageUri = new Uri("http://mysite.com/livetile.png")
                     };
t.Start();
t.Stop();

I have a Windows Phone 7 application that currently uses Live Tile Schedules to update.

The new version of the app uses a background task to update the tiles.

However after upgrading the app on a phone, if a tile schedule is already running on the main tile it doesn't stop updating.

I need to stop the tile schedule if it is running.

Creating a new schedule and stopping it doesn't work:

var t = new ShellTileSchedule()
                {
                    MaxUpdateCount = 1,
                    Recurrence = UpdateRecurrence.Onetime,
                    StartTime = DateTime.Now,
                    RemoteImageUri = new Uri("http://mysite.com/livetile.png"),
                };
t.Start();
t.Stop();

Creating a new schedule on the main tile in Active Tiles doesn't work:

ShellTile mainTile = ShellTile.ActiveTiles.FirstOrDefault();
t = new ShellTileSchedule(mainTile)
                    {
                        MaxUpdateCount = 1,
                        Recurrence = UpdateRecurrence.Onetime,
                        StartTime = DateTime.Now,
                        RemoteImageUri = new Uri("http://mysite.com/livetile.png")
                     };
t.Start();
t.Stop();

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

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

发布评论

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

评论(2

你的心境我的脸 2024-12-29 21:58:52

由于每个应用程序只能有一个 ShellTileSchedule,因此创建一个新的应用程序,启动它,然后停止它,应该删除旧的应用程序,当然还要停止您刚刚创建的应用程序。

(问之前为什么不尝试一下?)

Since you can only have one ShellTileSchedule per application, creating a new one, starting it, and then stopping it, should remove the old one, and of course stop the one you just created.

(Why didn't you try before asking?)

别再吹冷风 2024-12-29 21:58:52

首先,这个问题是否发生在实际部署到市场的应用程序中? (我的意思是,更新是否已部署?)如果没有,这可能与开发人员应用程序实际部署到手机的工作方式有关。

这里还有一些其他建议,我还没有测试过:
- 您是否尝试过从应用程序中删除?它是 ShellTileSchedule 所必需的,因此删除它可能会阻止它工作?当通过市场提交此应用程序时,这可能会自动发生,但为了进行测试,您可以尝试一下。
- ShellTileScheduel 如果失败可以取消。如果可能,您可以尝试删除 RemoteImageUri 中的 PNG 文件吗?或者用损坏的数据填充它以弄乱 ShellTileSchedule。我知道这不太漂亮,但它可能有用。
- 您是否尝试过将 ShellTileSchedule 替换为不会无限期重复出现的计划?只要让它执行(最后一次)然后它就完成了。

祝您好运,请告诉我们您是否修复以及如何修复。

First of all, is this problem occurring in an app that is actually deployed to the marketplace? (by that I mean, is the update deployed?) If it isn't this might have to do with the way the actual deployment of developer apps to a phone works.

Here's some other suggestions, I haven't tested any of them:
- Have you tried removing from your app? It's required for the ShellTileSchedule so removing it might stop it from working? This would probably happen automatically when submitting this app through the marketplace, but for testing you could give it a shot.
- A ShellTileScheduel can be cancelled if it fails. If possible, could you try to remove the PNG file that's in the RemoteImageUri. Or fill it with broken data to mess the ShellTileSchedule up. I know this isn't pretty, but it might work.
- Have you tried replacing the ShellTileSchedule with one that's not indefinitely recurring? Just make it execute (one last time) and then it finishes.

Good luck with it and please let us know if and how you fixed.

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