我正在用C#编写一个Windows 10通用应用程序,我想在其上创建一个可以更改的特定文本的磁贴。因此,我使用了示例代码形式microsoft MSDN (the second one)。但这并不适用于所有瓷砖,只有中等瓷砖显示文字“中”,其他瓷砖上只有应用标识。我想知道还有什么需要强制其他瓷砖更新。
这是我用来更新磁贴的代码:
public static void updateTile(){
TileContent content = new TileContent() {
Visual = new TileVisual() {
TileSmall = new TileBinding() {
Content = new TileBindingContentAdaptive() {
Children = {
new TileText() { Text = "Small" }
}
}
},
TileMedium = new TileBinding() {
Content = new TileBindingContentAdaptive() {
Children = {
new TileText() { Text = "Medium" }
}
}
},
TileWide = new TileBinding() {
Content = new TileBindingContentAdaptive() {
Children = {
new TileText() { Text = "Wide" }
}
}
},
TileLarge = new TileBinding() {
Content = new TileBindingContentAdaptive() {
Children = {
new TileText() { Text = "Large" }
}
}
}
}
};
// And then update the primary tile
TileUpdateManager.CreateTileUpdaterForApplication().Update(new TileNotification(content.GetXml()));
}