Windows 8 Windows 8 Live互动程序更新不工作

Windows 8 Windows 8 Live互动程序更新不工作,windows-8,microsoft-metro,windows-runtime,live-tile,Windows 8,Microsoft Metro,Windows Runtime,Live Tile,我正在编写一个Windows 8应用程序,并试图让live tiles正常工作。以下是我到目前为止所掌握的内容(全部在App.xaml.cs): 在OnLaunched()中: 该事件的事件处理程序: void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e) { // create a string with the tile template xml s

我正在编写一个Windows 8应用程序,并试图让live tiles正常工作。以下是我到目前为止所掌握的内容(全部在
App.xaml.cs
):

OnLaunched()中

该事件的事件处理程序:

void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
{
    // create a string with the tile template xml
    string tileXmlString = "<tile><visual><binding template=\"TileSquareBlock\">" + App.VM.GetImageLinks() + "</binding></visual></tile>";

    // create a DOM
    Windows.Data.Xml.Dom.XmlDocument tileDOM = new Windows.Data.Xml.Dom.XmlDocument();
    // load the xml string into the DOM, catching any invalid xml characters 
    tileDOM.LoadXml(tileXmlString);

    // create a tile notification
    TileNotification tile = new TileNotification(tileDOM);

    // send the notification to the app's application tile
    TileUpdateManager.CreateTileUpdaterForApplication().Update(tile);
}

目前,我基本上只是想让这些图像显示在开始屏幕上。我猜
VisibilityChanged
是错误的事件,因为它似乎太频繁了。

所使用的XML无效,因为TileSquareBlock模板不包含任何图像。请参阅以查看各种可视模板及其对应的XML


NotificationsExtensions库(位于中)提供了一个对象模型,用于将图像和文本字段映射到命名属性。它提供了更多验证,并可能简化代码。

所使用的XML无效,因为TileSquareBlock模板不包含任何图像。请参阅以查看各种可视模板及其对应的XML


NotificationsExtensions库(位于中)提供了一个对象模型,用于将图像和文本字段映射到命名属性。它提供了更多的验证,并可能简化您的代码。

是的,我想他想要tileSquareImage是的,我想他想要tileSquareImage
void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
{
    // create a string with the tile template xml
    string tileXmlString = "<tile><visual><binding template=\"TileSquareBlock\">" + App.VM.GetImageLinks() + "</binding></visual></tile>";

    // create a DOM
    Windows.Data.Xml.Dom.XmlDocument tileDOM = new Windows.Data.Xml.Dom.XmlDocument();
    // load the xml string into the DOM, catching any invalid xml characters 
    tileDOM.LoadXml(tileXmlString);

    // create a tile notification
    TileNotification tile = new TileNotification(tileDOM);

    // send the notification to the app's application tile
    TileUpdateManager.CreateTileUpdaterForApplication().Update(tile);
}
<tile>
    <visual>
        <binding template=\"TileSquareBlock\">
            <image id=\"1\">Assets/Img1.jpg</image>
            <image id=\"2\">Assets/Img2.jpg</image>
            <image id=\"3\">Assets/Img3.jpg</image>
        </binding>
    </visual>
</tile>