Использование шаблонов плитки windows8

Я пытаюсь использовать шаблоны плиток (плитка, которая показывает изображение и переключается на отображение текста)

http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx#TileSquarePeekImageAndText04

Вопрос в том, куда мне поместить этот XML и как я могу вызвать его в XAML?


person user1428798    schedule 15.10.2012    source источник
comment
вы пробовали читать документацию? msdn.microsoft.com /en-us/library/windows/apps/xaml/   -  person N_A    schedule 15.10.2012


Ответы (1)


Вы не вызываете его в XAML, вы предоставляете его TileUpdater, как видно из документации по TileUpdateManager ниже. Этот упрощенный сценарий обрабатывает локальное уведомление (но есть также по расписанию, периодические и push уведомления, которые вы можете использовать).

Взгляните на плитки и значки приложений. и образцы Push и периодических уведомлений для руководства.

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);
}
person Jim O'Neil    schedule 15.10.2012