BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates and initializes a new instance of the BadgeUpdater, which enables you to change the appearance or content of a badge on a secondary tile. The tile can belong to the calling app or any other app in the same package.
public:
static BadgeUpdater ^ CreateBadgeUpdaterForSecondaryTile(Platform::String ^ tileId);
static BadgeUpdater CreateBadgeUpdaterForSecondaryTile(winrt::hstring const& tileId);
public static BadgeUpdater CreateBadgeUpdaterForSecondaryTile(string tileId);
function createBadgeUpdaterForSecondaryTile(tileId)
Public Shared Function CreateBadgeUpdaterForSecondaryTile (tileId As String) As BadgeUpdater
Parameters
- tileId
-
String
Platform::String
winrt::hstring
The unique ID of the tile.
Returns
The object you will use to send badge updates to the tile identified by tileID.
Examples
The following example demonstrates how to send a numeric badge notification to a secondary tile with an ID of "SecondaryTile.Dynamic".
// Define the badge content
var badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);
var badgeAttributes = badgeXml.GetElementsByTagName("badge");
badgeAttributes[0].Attributes.Where(a => a.LocalName.ToString() == "value").First().NodeValue = "6";
// Create the notification based on the XML content.
var badge = new BadgeNotification(badgeXml);
// Create a secondary tile updater, passing it the ID of the tile.
var tileUpdater = BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile("SecondaryTile.Dynamic");
// Send the notification to the secondary tile.
tileUpdater.Update(badge);