Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The XML payload that you construct for your tile notifications must be no larger than 5 KB. Otherwise, you will get a COMException with HResult 0x803E0115 saying that "The size of the notification content is too large."
To fix this, you should set limits on the content that you put into your tile notifications. For example, if you're displaying a message that another user typed, limit it to a max number of characters.
The max number of characters you will want to use depends on the tile size. The medium tile is smaller than the large tile - hence, you can trim your string much earlier for the medium tile notification.
Max # of characters per line for each tile size and each font size
TileMedium
TileWide
TileLarge
TileSmall
The max number of lines of text that can be displayed also depends on your tile size, the device, display scaling options, and whether branding is displayed. Here are the max number of lines that can possibly be displayed for each tile size.
TileMedium/TileWide
TileLarge
TileSmall
If you are including images in your tile notifications, and your images have the same base URL, you can reduce the redundant leading base URL by using the baseUri property.
In the following example, all of our images are located in Assets/Apps/Weather, so we use the baseUri so that we don't have to redundantly specify this portion of the URL in every single image. We can simply specify the file name.
<tile>
<visual displayName="Seattle" baseUri="Assets/Apps/Weather/">
<binding template="TileMedium" branding="name" hint-overlay="30">
<image src="Mostly Cloudy-Background.jpg" placement="background"/>
<group>
<subgroup>
<text hint-align="center">Mon</text>
<image src="Mostly Cloudy.png" hint-removeMargin="true"/>
<text hint-align="center">63°</text>
<text hint-style="captionSubtle" hint-align="center">42°</text>
</subgroup>
<subgroup>
<text hint-align="center">Tue</text>
<image src="Cloudy.png" hint-removeMargin="true"/>
<text hint-align="center">57°</text>
<text hint-style="captionSubtle" hint-align="center">38°</text>
</subgroup>
</group>
</binding>
</visual>
</tile>
TileContent content = new TileContent()
{
Visual = new TileVisual()
{
BaseUri = new Uri("Assets/Apps/Weather", UriKind.Relative),
TileMedium = new TileBinding()
{
DisplayName = "Seattle",
Branding = TileBranding.Name,
Content = new TileBindingContentAdaptive()
{
Children =
{
new AdaptiveGroup()
{
Children =
{
CreateSubgroup("Mon", "Mostly Cloudy.png", "63°", "42°"),
CreateSubgroup("Tue", "Cloudy.png", "57°", "38°")
}
}
}
}
}
}
};
...
private static AdaptiveSubgroup CreateSubgroup(string day, string image, string highTemp, string lowTemp)
{
return new AdaptiveSubgroup()
{
Children =
{
new AdaptiveText()
{
Text = day,
HintAlign = AdaptiveTextAlign.Center
},
new AdaptiveImage()
{
Source = image,
HintRemoveMargin = true
},
new AdaptiveText()
{
Text = highTemp,
HintAlign = AdaptiveTextAlign.Center
},
new AdaptiveText()
{
Text = lowTemp,
HintAlign = AdaptiveTextAlign.Center,
HintStyle = AdaptiveTextStyle.CaptionSubtle
}
}
};
}
Tile elements have specific default values, which means that if you want the default value, there's no need to explicitly specify the value.
For example, as seen below, there's no need to specify the caption and disable text wrapping, since these are both default values.
<binding template="TileMedium">
<text hint-style="caption" hint-wrap="false">Snowboarding with Mark</text>
<text hint-style="captionSubtle" hint-wrap="true">Fri: 9:00 AM</text>
</binding>
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in