[英]Windows Phone 8.1 How to programatically create a tile with specified template
簡單! 您需要將代碼塊模板(XML字符串)解析為代碼中的XElement對象:
var template = "<tile>etc</tile>";
var tileXe = XElement.Parse(template);
在此之前或之后根據自己的喜好配置模板xml(演示在您鏈接的文章中)
然后將其發布到磁貼管理器
var tileNotification = new TileNotification(tileXe);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
只要此代碼在UI線程上運行,就可以在應用程序中的任何位置執行此操作。 還要注意,您上一次檢查磁貼最多每15秒一次,您可以更新磁貼的頻率是有限制的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.