binding

Specifies the toast template. Note that only one binding element can be included in a toast notification.

Element hierarchy

<toast>
<visual>
<binding>

Syntax

<binding template       = "ToastImageAndText01" | "ToastImageAndText02" | "ToastImageAndText03" | ...
         fallback?      = string
         lang?          = string
         addImageQuery? = boolean
         baseUri?       = anyURI
         branding?      = string >

  <!-- Child elements -->
  ( image
  | text
  )*

</binding>

Key

?   optional (zero or one)
*   optional (zero or more)

Attributes and Elements

Attributes

AttributeDescriptionData typeRequiredDefault value
addImageQuery

Set to "true" to allow Windows 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; for instance, a value of

"www.website.com/images/hello.png"

given in the notification becomes

"www.website.com/images/hello.png?ms-scale=100&ms-contrast=standard&ms-lang=en-us"

booleanNofalse
baseUri

A default base URI that is combined with relative URIs in image source attributes.

anyURINoms-appx:///
branding

Not used.

This attribute can have one of the following values:

  • none
  • logo
  • name
NoNone
fallback

A template to use if the primary template cannot be found, for use with backward compatibility.

stringNoNone
lang

The target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides that in visual, but can be overriden by that in 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.

stringNoNone
template

One of the provided templates on which to base the toast. Values are given in the toastTemplateType enumeration.

This attribute can have one of the following values:

  • ToastImageAndText01
  • ToastImageAndText02
  • ToastImageAndText03
  • ToastImageAndText04
  • ToastText01
  • ToastText02
  • ToastText03
  • ToastText04
YesNone

 

Child Elements

Child ElementDescription
image

Specifies an image used in the toast template.

text

Specifies text used in the toast template.

 

Parent Elements

Parent ElementDescription
visual

Contains a single binding element that defines a toast.

 

Remarks

To see examples of each of the toast templates, see the toast template catalog.

Requirements

Namespace

http://schemas.microsoft.com/notifications/2012/toast.xsd

 

 

Show:
© 2014 Microsoft