Dela via


TileNotification.Tag Property

Definition

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

public:
 property Platform::String ^ Tag { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Tag();

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

Property Value

String

Platform::String

winrt::hstring

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.

Applies to

See also