以适当的尺寸更新活动瓷砖? [英] Updating a live tile in its proper size?

查看:36
本文介绍了以适当的尺寸更新活动瓷砖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 8中更新实时磁贴时,我不知道如何同时以大"和小"大小更新磁贴.

When updating live tiles in Windows 8, I don't know how to update the tile in both the "large" and "small" size at the same time.

我希望将应用程序固定在小模式下的用户知道程序中有多少项可供查看,而将应用程序固定在大模式下的用户既具有该功能,又具有一些示例项标题.

I would like users who have my app pinned in small mode to know how many items that are available in my program for viewing, and users who have my app pinned in large mode have both that, and some sample item titles too.

但是,无论我做什么,似乎只有一个磁贴更新会到达.如何根据图块的大小进行图块更新,以使拥有小图块或大图块的人都不会失望?

However, no matter what I do, it seems that only one of the tile updates arrive. How can I deliver a tile update based on the size of my tile, so that people who have either the small or large one won't be disappointed?

推荐答案

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

Content for both the square and wide tile format can (and should) be included in the XML defining each tile notification. Under the visual element, simply add two binding elements: one using a wide tile template, and one using a square tile template.

<tile>
    <visual lang="en-US">
        <binding template="TileWideText03">
            <text id="1">Hello World!</text>
        </binding>
        <binding template="TileSquareText04">
            <text id="1">Hello World!</text>
        </binding>
    </visual>
</tile>

NotificationsExtensions库(位于 MSDN磁贴示例中)提供了一个对象模型,可以轻松地处理XML并结合正方形和宽块内容:

The NotificationsExtensions library (found in the MSDN tiles sample) provides an object model to easily manipulate the XML and combine square and wide tile content:

// 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; 

这篇关于以适当的尺寸更新活动瓷砖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆