In windows 8 metro style app, how to update live tile while app is not running?

前端 未结 2 1228
南方客
南方客 2021-02-02 03:49

In windows 8 metro style app, how to update live tile while app is not running ?

And the live tile start to run when OS system begin to start.

http://blogs.msdn.

2条回答
  •  天涯浪人
    2021-02-02 04:21

    Okay, let's get you answered! Here is every single way and resources for each way to get you started. Your scenario isn't clear to me, so I will try to be generic.

    There are four ways to update a live tile in Windows 8! And this is true for the primary app tile and the subsequent secondary tiles created by the app, too.

    1> The first is that the app, while running, can update the tile

    • http://thesociablegeek.com/windows-8/livetiles/working-with-live-tiles-locally/

    But, you were asking how to update when it is not running:

    2> A user can deploy a background task with their Windows 8 app. This background task executes periodically and can update the tile of the app during its execution. The minimum frequency of background tasks is 15 minutes. Windows 8 allocates 1 CPU second every two hours to a task. Your task can execute as often as you want until you exhaust its allocation.

    • http://thesociablegeek.com/windows-8/livetiles/modifying-live-tiles-in-a-background-process/

    3> An app can open a WNS (Windows Notification Services) channel while it is running. When it is not running, a web service can push tile updates across WNS.

    • http://msdn.microsoft.com/en-us/library/windows/apps/hh465460.aspx
    • http://visualstudiomagazine.com/articles/2012/03/25/using-push-notifications-in-windows-8.aspx
    • http://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh868253(v=win.10).aspx

    4> A tile can be configured to pull from a URL. The XML from that URL is periodically evaluated for deltas and the tile is refreshed when detected. Tiles expire by default after three days.

    • http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.notifications.tileupdater.startperiodicupdate.aspx
    • http://msdn.microsoft.com/en-us/library/windows/apps/hh761476.aspx

    Point of clarification: you can't cause something like a tile update when the OS is booted. For one, in Windows 8 the idea of rebooting (or at least shutting down) is practically deprecated. But your Store app can only execute in the ways above - and can't do something like the StartUp folder (in the past) or RegEdit/Run (in the past) just the stuff above. But maintenance or timer triggers get you pretty close.

    And, that's the answer. Best of luck, dude!

提交回复
热议问题