Can I change the background color of the primary tile in WinRT?

本秂侑毒 提交于 2020-01-11 07:15:08

问题


Is it possible to change the background color of the primary tile of my WinRT app? I'd like to change it according to app status.

I use this code for changing the text of the tile:

XmlDocument contentSmall = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text02);
contentSmall.GetElementsByTagName(textElementName)[1].InnerText = "---";
TileNotification notifSmall = new TileNotification(contentSmall);
TileUpdateManager.CreateTileUpdaterForApplication().Update(notifSmall);

回答1:


For the primary tile, the background color for most templates uses the app's color indicated in the manifest. This is done by design to promote a consistent branding via color for the app (tile, flyout panels, etc., all use the same color). However, if you use an image-only template and generate images on the fly, then of course you can use whatever colors you want.

Generally speaking, however, live tiles are not intended to be used like gadgets. App status is more rightly indicated through badges on the tile, rather than the entire tile itself.

The color limitation does not apply to secondary tiles, as they have background color and foreground text properties you can control individually.

All this applies equally to tile updates sent from the app or from a background task--they use the same API so there's nothing unique to either.



来源:https://stackoverflow.com/questions/28597017/can-i-change-the-background-color-of-the-primary-tile-in-winrt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!