以适当的大小更新实时图块?

在Windows 8中更新实时切片时,我不知道如何同时更新“大”和“小”大小的切片。

我希望将我的应用程序固定在小模式下的用户知道我的程序中有多少可用于查看的项目,并且我的应用程序以大模式固定的用户同时拥有该项目以及一些示例项目标题。

但是,无论我做什么,似乎只有一个磁贴更新到达。 如何根据我的瓷砖尺寸提供瓷砖更新,以便那些拥有小型或大型瓷砖的人不会失望?

方形和宽平铺格式的内容可以(并且应该)包含在定义每个平铺通知的XML中。 在visual元素下,只需添加两个binding元素:一个使用宽的平铺模板,另一个使用方形平铺模板。

    Hello World!   Hello World!    

NotificationsExtensions库(在MSDN tiles示例中找到 )提供了一个对象模型,可以轻松地操作XML并组合正方形和宽平铺内容:

 // create the wide template ITileWideText03 tileContent = TileContentFactory.CreateTileWideText03(); tileContent.TextHeadingWrap.Text = "Hello World!"; // create the square template and attach it to the wide template ITileSquareText04 squareContent = TileContentFactory.CreateTileSquareText04(); squareContent.TextBodyWrap.Text = "Hello World!"; tileContent.SquareContent = squareContent; 

tile XML需要组合起来,如下所示:

    01 Tue    some text    

现在有很多方法可以将XML用于这种forms,但我最喜欢的方法是使用NotificationsExtensions库来封装XML操作。

在项目中引用库后,您的代码应如下所示:

 // create the wide template ITileWide310x150PeekImageAndText01 wideContent = TileContentFactory.CreateTileWide310x150PeekImageAndText01(); wideContent.TextBodyWrap.Text = "some text"; wideContent.Image.Src = "ms-appx:///Assets/WideLogo.png"; // create the square template and attach it to the wide template ITileSquare150x150Block squareContent = TileContentFactory.CreateTileSquare150x150Block(); squareContent.TextBlock.Text = "01"; squareContent.TextSubBlock.Text = "Tue"; wideContent.Square150x150Content = squareContent; var tn = new TileNotification(wideContent.GetXml()); TileUpdateManager.CreateTileUpdaterForApplication("App").Clear(); TileUpdateManager.CreateTileUpdaterForApplication("App").Update(tn);