ToastBindingGeneric Class

Definition

Generic Toast binding, where you provide text, images, and other visual elements for your Toast notification.

C#
public sealed class ToastBindingGeneric
Inheritance
ToastBindingGeneric

Constructors

Properties

AddImageQuery

Gets or sets a value whether Windows is allowed to append a query string to the image URI supplied in the Toast notification. Use this attribute if your server hosts images and can handle query strings, either by retrieving an image variant based on the query strings or by ignoring the query string and returning the image as specified without the query string. This query string specifies scale, contrast setting, and language.

AppLogoOverride

Gets or sets an optional override of the logo displayed on the Toast notification.

Attribution

Gets or sets an optional text element that is displayed as attribution text. On devices without the Anniversary Update, this text will appear as if it's another AdaptiveText element at the end of your Children list.

BaseUri

Gets or sets a default base URI that is combined with relative URIs in image source attributes.

Children

Gets the contents of the body of the Toast, which can include AdaptiveText, AdaptiveImage, and AdaptiveGroup (added in Anniversary Update). Also, AdaptiveText elements must come before any other elements. If an AdaptiveText element is placed after any other element, an exception will be thrown when you try to retrieve the Toast XML content. And finally, certain AdaptiveText properties like HintStyle aren't supported on the root children text elements, and only work inside an AdaptiveGroup. If you use AdaptiveGroup on devices without the Anniversary Update, the group content will simply be dropped.

HeroImage

Gets or sets an optional hero image (a visually impactful image displayed on the Toast notification). On devices without the Anniversary Update, the hero image will simply be ignored.

Language

Gets or sets the target locale of the XML payload, specified as BCP-47 language tags such as "en-US" or "fr-FR". This locale is overridden by any locale specified in binding or text. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string.

Applies to

Produit Versions
Windows Community Toolkit 7.0.0