Xaml 在windows8中使用平铺模板
我正在尝试使用tiles模板(显示图像并切换到显示文本的tile)Xaml 在windows8中使用平铺模板,xaml,windows-8,microsoft-metro,tiles,Xaml,Windows 8,Microsoft Metro,Tiles,我正在尝试使用tiles模板(显示图像并切换到显示文本的tile) 问题是:我应该将这个XML放在哪里,如何在XAML中调用它?您不在XAML中调用它,而是将它提供给一个实例,如下面的文档所示。这个简单化的场景处理一个事件(但也有一些事件和通知,您可以利用它们) 请查看以下内容和示例以获取指导 function sendTileTextNotification() { var Notifications = Windows.UI.Notifications; // Get a
问题是:我应该将这个XML放在哪里,如何在XAML中调用它?您不在XAML中调用它,而是将它提供给一个实例,如下面的文档所示。这个简单化的场景处理一个事件(但也有一些事件和通知,您可以利用它们) 请查看以下内容和示例以获取指导
function sendTileTextNotification() {
var Notifications = Windows.UI.Notifications;
// Get an XML DOM version of a specific template by using getTemplateContent.
var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWideText03);
// You will need to look at the template documentation to know how many text fields a particular template has.
// Get the text attribute for this template and fill it in.
var tileAttributes = tileXml.getElementsByTagName("text");
tileAttributes[0].appendChild(tileXml.createTextNode("Hello World!"));
// Create the notification from the XML.
var tileNotification = new Notifications.TileNotification(tileXml);
// Send the notification to the calling app's tile.
Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
}
你试过阅读文档吗?