系結 (磚架構)

指定圖格範本。 每個通知都應該針對每個支援的磚大小包含一個綁定項。

元素階層

<瓦>
<視覺>
<binding>

Syntax

<binding template       = tileTemplateNameV2
         fallback?      = tileTemplateNameV1
         lang?          = string
         baseUri?       = anyURI
         branding?      = "none" | "logo" | "name"
         addImageQuery? = boolean
         contentId?     = string >

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

</binding>

答案

? 選擇性 (零或一個) 選擇性 (* 零或多個)

屬性和項目

屬性

屬性 描述 資料類型 必要 預設值
addImageQuery

設定為 true 可讓 Windows 將查詢字串附加至磚通知中提供的影像 URI。 如果您的伺服器裝載影像,並且可以處理查詢字串 (方式為根據查詢字串擷取影像變體,或忽略查詢字串並傳回未使用查詢字串所指定的影像),請使用此屬性。 此查詢字串會指定縮放比例、對比設定和語言;例如,的 值為

“www.website.com/images/hello.png”

包含在通知中會變成

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

boolean No false
baseUri

與影像來源屬性中相對 URI 結合的預設基底 URI。

anyURI No ms-appx:///
品牌

磚應用來顯示應用程式品牌的表單。

此屬性可以有下列其中一個值:

  • 標誌
  • NAME
標誌
contentId

設定為可唯一識別通知內容的寄件者定義字串。 這可防止大型磚範本顯示最後三個寬磚通知的情況重複。

字串 No
後備

如果收件者無法辨識主要範本名稱,則為要使用的範本,以搭配 Windows 8 相容性使用。 這個值是範本屬性中值的 Windows 8 名稱。 Windows 8 后引進的新範本沒有後援。

tileTemplateNameV1 (請參閱) No

XML 承載的目標地區設定,指定為 BCP-47 語言標記 ,例如 “en-US” 或 “fr-FR”。 此處指定的地區設定會覆寫 視覺效果中的地區設定,但可以 透過文字覆寫。 如果此值為常值字串,則此屬性預設為使用者的 UI 語言。 如果此值為字串參考,則此屬性預設為 Windows 執行階段在解析字串時所選擇的地區設定。 如需未指定此值,請參閱。

字串 No
template

其中一個提供的範本,用來建立磚的基礎。 一般而言,開發人員應該同時提供方形和寬格式,每個格式都是個別的 綁定 項。 有效專案是 tileTemplateType 列舉的成員。

tileTemplateNameV2 (請參閱) Yes

 

子元素

子元素 描述
image

指定磚範本中使用的影像。 提供的映像應該符合該範本內特定範本或映像的大小和圖形需求。

text

指定磚範本中使用的文字。

 

父項目

Parent 項目 Description
視覺

包含多個 系結 子專案,每個專案都會定義圖格。

 

備註

範本屬性中使用的 tileTemplateNameV2 值可以是下列其中一個字串值。 如需每個範本的詳細資訊,請參閱 圖格範本目錄

  • TileSquare150x150Block
  • TileSquare150x150Image
  • TileSquare150x150PeekImageAndText01
  • TileSquare150x150PeekImageAndText02
  • TileSquare150x150PeekImageAndText03
  • TileSquare150x150PeekImageAndText04
  • TileSquare150x150Text01
  • TileSquare150x150Text02
  • TileSquare150x150Text03
  • TileSquare150x150Text04
  • TileSquare310x310BlockAndText01
  • TileSquare310x310BlockAndText02
  • TileSquare310x310Image
  • TileSquare310x310ImageAndText01
  • TileSquare310x310ImageAndText02
  • TileSquare310x310ImageAndTextOverlay01
  • TileSquare310x310ImageAndTextOverlay02
  • TileSquare310x310ImageAndTextOverlay03
  • TileSquare310x310ImageCollection
  • TileSquare310x310ImageCollectionAndText01
  • TileSquare310x310ImageCollectionAndText02
  • TileSquare310x310SmallImagesAndTextList01
  • TileSquare310x310SmallImagesAndTextList02
  • TileSquare310x310SmallImagesAndTextList03
  • TileSquare310x310SmallImagesAndTextList04
  • TileSquare310x310Text01
  • TileSquare310x310Text02
  • TileSquare310x310Text03
  • TileSquare310x310Text04
  • TileSquare310x310Text05
  • TileSquare310x310Text06
  • TileSquare310x310Text07
  • TileSquare310x310Text08
  • TileSquare310x310TextList01
  • TileSquare310x310TextList02
  • TileSquare310x310TextList03
  • TileWide310x150BlockAndText01
  • TileWide310x150BlockAndText02
  • TileWide310x150Image
  • TileWide310x150ImageAndText01
  • TileWide310x150ImageAndText02
  • TileWide310x150ImageCollection
  • TileWide310x150PeekImage01
  • TileWide310x150PeekImage02
  • TileWide310x150PeekImage03
  • TileWide310x150PeekImage04
  • TileWide310x150PeekImage05
  • TileWide310x150PeekImage06
  • TileWide310x150PeekImageAndText01
  • TileWide310x150PeekImageAndText02
  • TileWide310x150PeekImageCollection01
  • TileWide310x150PeekImageCollection02
  • TileWide310x150PeekImageCollection03
  • TileWide310x150PeekImageCollection04
  • TileWide310x150PeekImageCollection05
  • TileWide310x150PeekImageCollection06
  • TileWide310x150SmallImageAndText01
  • TileWide310x150SmallImageAndText02
  • TileWide310x150SmallImageAndText03
  • TileWide310x150SmallImageAndText04
  • TileWide310x150SmallImageAndText05
  • TileWide310x150Text01
  • TileWide310x150Text02
  • TileWide310x150Text03
  • TileWide310x150Text04
  • TileWide310x150Text05
  • TileWide310x150Text06
  • TileWide310x150Text07
  • TileWide310x150Text08
  • TileWide310x150Text09
  • TileWide310x150Text10
  • TileWide310x150Text11

屬性中使用的 tileTemplateNameV1 值可以是下列其中一個字串值。 這些是範本名稱 Windows 8。 如需每個範本的詳細資訊,請參閱 磚範本目錄

  • TileSquareBlock
  • TileSquareImage
  • TileSquarePeekImageAndText01
  • TileSquarePeekImageAndText02
  • TileSquarePeekImageAndText03
  • TileSquarePeekImageAndText04
  • TileSquareText01
  • TileSquareText02
  • TileSquareText03
  • TileSquareText04
  • TileWideBlockAndText01
  • TileWideBlockAndText02
  • TileWideImage
  • TileWideImageAndText01
  • TileWideImageAndText02
  • TileWideImageCollection
  • TileWidePeekImage01
  • TileWidePeekImage02
  • TileWidePeekImage03
  • TileWidePeekImage04
  • TileWidePeekImage05
  • TileWidePeekImage06
  • TileWidePeekImageAndText01
  • TileWidePeekImageAndText02
  • TileWidePeekImageCollection01
  • TileWidePeekImageCollection02
  • TileWidePeekImageCollection03
  • TileWidePeekImageCollection04
  • TileWidePeekImageCollection05
  • TileWidePeekImageCollection06
  • TileWideSmallImageAndText01
  • TileWideSmallImageAndText02
  • TileWideSmallImageAndText03
  • TileWideSmallImageAndText04
  • TileWideSmallImageAndText05
  • TileWideText01
  • TileWideText02
  • TileWideText03
  • TileWideText04
  • TileWideText05
  • TileWideText06
  • TileWideText07
  • TileWideText08
  • TileWideText09
  • TileWideText10
  • TileWideText11

下表說明未指定 lang 時,系統如何回應。

如需... 系統回應
通知的語言
  • 如果明確設定,請使用visual.lang或binding.lang
  • 否則,應用程式特定語言設定 (語言,如果有的話,[資源管理系統] (/previous-versions/windows/apps/jj552947 (v=win.10) ) 會決定應用程式將在目前的語言配置檔中執行)
  • 否則,Windows 執行階段 解析磚上的顯示名稱語言
  • 否則殼層的UI語言 (MUI 語言)

此語言主要會影響功能數據行之範本中的數據行配置。

具有常值文字的文字元素
  • 如果明確設定,請使用visual.lang或binding.lang
  • 否則,應用程式特定語言設定 (語言,如果有的話,[資源管理系統] (/previous-versions/windows/apps/jj552947 (v=win.10) ) 會決定應用程式將在目前的語言配置檔中執行)
  • 否則,Windows 執行階段 解析磚上的顯示名稱語言
  • 否則殼層的UI語言 (MUI 語言)
具有 ms-resource 內容的文字元素
  • 如果明確設定,請使用visual.lang或 binding.lang,而明確語言會加上語言清單資源管理系統的 [ResourceContext] (/previous-versions/windows/apps/jj552947 (v=win.10) #resourcecontext) 用來解析字元串的字符串
  • 否則 [ResourceContext] (/previous-versions/windows/apps/jj552947 (v=win.10) #resourcecontext) 以使用者的語言配置檔初始化

解析字串之後,解析字串的語言會指派給文字元素。 此語言會 (LTR 與 RTL) 和 UI 的字型選取來塑造文字對齊方式。

ms-appx:/// image
  • 如果明確設定,請使用visual.lang或binding.lang,則會將明確的語言列在資源管理系統的 [ResourceContext] (/previous-versions/windows/apps/jj552947 (v=win.10) #resourcecontext) 用來解析字元串的字符串
  • 否則 [ResourceContext] (/previous-versions/windows/apps/jj5552947 (v=win.10) #resourcecontext) 以使用者的語言配置檔初始化
雲端映像
  • 如果明確設定,請使用visual.lang或binding.lang
  • 否則,應用程式特定語言設定 (語言,如果有的話,[資源管理系統] (/previous-versions/windows/apps/jj552947 (v=win.10) ) 會決定應用程式將在指定的目前語言配置檔中執行)
  • 否則,如果名稱為非語言中性) ,可能無法設定磚上 Windows 執行階段 (解析的顯示名稱語言
  • 否則殼層的UI語言 (MUI 語言)

如果 addImageQuery 為 true,此語言會包含在查詢字串中。

 

規格需求

Namespace http://schemas.microsoft.com/notifications/2012/tile.xsd