[英]Updating live tile in Windows Phone 8.1 Offline
我已經成功使用以下代碼為我的應用創建了實時圖塊:
var tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150PeekImageAndText01);
var tileImage = tileXml.GetElementsByTagName("image")[0] as XmlElement;
tileImage.SetAttribute("src", "ms-appx:///Assets/Icon.png");
var tileText = tileXml.GetElementsByTagName("text");
(tileText[0] as XmlElement).InnerText = ""+DateTime.Now.ToString();
(tileText[1] as XmlElement).InnerText = "1";
(tileText[2] as XmlElement).InnerText = "2";
(tileText[3] as XmlElement).InnerText = "3";
var tileNotification = new TileNotification(tileXml);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
但是,我不確定如何使用調度程序代理使活動磁貼自動更新。 我已經看過使用TileUpdateManager.StartPeriodicAgent,但是它需要一個URI參數,並且我想避免創建一個服務器來更新我的活動圖塊。
有辦法嗎? 非常感謝:D
您需要從您的應用程序中運行后台代理,然后在其中放置實時磁貼更新代碼。
MSDN上的主題:
Windows Phone 8.1上的后台代理/多任務處理:
http://www.jayway.com/2014/04/23/windows-phone-8-1-for-developers-multitasking-and-background-tasks/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.