Dela via


BadgeNotification(XmlDocument) Constructor

Definition

Creates and initializes a new instance of the BadgeNotification.

public:
 BadgeNotification(XmlDocument ^ content);
 BadgeNotification(XmlDocument const& content);
public BadgeNotification(XmlDocument content);
function BadgeNotification(content)
Public Sub New (content As XmlDocument)

Parameters

content
XmlDocument

The XML content that defines the badge update.

Examples

The following example code uses the BadgeNotification method to create a numeric badge notification.

// Create a numeric badge notification
var badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);
var badgeAttributes = badgeXml.GetElementsByTagName("badge");
badgeAttributes[0].Attributes.Where(a => a.LocalName.ToString() == "value").First().NodeValue = "26";

// Create a badge notification from XML
var badgeNotification = new BadgeNotification(badgeXml);

Remarks

The value attribute can be a number from 1-99 or a status glyph. See the Badge overview for a complete list of available images.

Applies to

See also