TileNotification.Tag TileNotification.Tag TileNotification.Tag TileNotification.Tag TileNotification.Tag Property

Definition

Gets or sets a string that Windows can use to prevent duplicate notification content from appearing in the queue.

public : Platform::String Tag { get; set; }
winrt::hstring Tag();

void Tag(winrt::hstring tag);
public string Tag { get; set; }
Public ReadWrite Property Tag As string
var string = tileNotification.tag;
tileNotification.tag = string;

Property Value

string string string

A string of 16 characters or less (plus a terminating null character) that identifies the notification in the stack. While there is no set form to the string content, we recommend that it should relate to the content of the notification.

Remarks

Use tags to replace notifications in the stack. If a new notification arrives with the same tag as an existing notification, the new notification replaces the old. For instance, if your tile shows stock prices, you want to show the most up-to-date info. An existing stock price update waiting in the queue to be displayed should be replaced by the latest quotes rather than showing them one after the other.

A new notification with a matching tag replaces any existing notification with the same tag, but the new notification does not necessarily inherit the older notification's place in the queue.

The tag should relate to the content of the notification. For example, a notification in a stock quote app could use the stock symbol (such as "msft") while a weather app notification could be tagged with the zip code (such as "98052") of the forecast. Do not simply number your notifications as "notification1", "notification2" and so on.

See also