TileUpdateManager.CreateTileUpdaterForSecondaryTile(String) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Membuat dan menginisialisasi instans baru TileUpdater, yang memungkinkan Anda mengubah tampilan petak sekunder. Petak peta dapat dimiliki oleh aplikasi panggilan atau aplikasi lain dalam paket yang sama.
public:
static TileUpdater ^ CreateTileUpdaterForSecondaryTile(Platform::String ^ tileId);
static TileUpdater CreateTileUpdaterForSecondaryTile(winrt::hstring const& tileId);
public static TileUpdater CreateTileUpdaterForSecondaryTile(string tileId);
function createTileUpdaterForSecondaryTile(tileId)
Public Shared Function CreateTileUpdaterForSecondaryTile (tileId As String) As TileUpdater
Parameter
- tileId
-
String
Platform::String
winrt::hstring
ID unik untuk petak peta.
Mengembalikan
Objek yang akan Anda gunakan untuk mengirim pembaruan ke petak peta yang diidentifikasi oleh tileID.
Contoh
Contoh berikut menunjukkan cara mengirim pemberitahuan ke petak sekunder.
var Notifications = Windows.UI.Notifications;
// Define the notification content.
var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWide310x150Text04);
var tileTextAttributes = tileXml.getElementsByTagName("text");
tileTextAttributes[0].appendChild(tileXml.createTextNode("Sent to a secondary tile!"));
// Provide a medium version of the notification as well, remembering that the user has control
// over whether the tile is displaying as wide or square.
var squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquare150x150Text04);
var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode("Sent to a secondary tile!"));
// Add the medium tile to the notification.
var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
tileXml.getElementsByTagName("visual").item(0).appendChild(node);
// Create the notification based on the XML content.
var tileNotification = new Notifications.TileNotification(tileXml);
// Create a secondary tile updater and pass it the secondary tileId
var tileUpdater = Notifications.TileUpdateManager.createTileUpdaterForSecondaryTile("SecondaryTile.Dynamic");
// Send the notification to the secondary tile.
tileUpdater.update(tileNotification);
Berlaku untuk
Lihat juga
- Sampel petak peta dan lencana aplikasi
- Mulai cepat: Mengirim pembaruan petak peta
- Gambaran umum pemberitahuan petak dan petak peta
- Katalog templat petak peta
- Panduan dan daftar periksa petak peta
- Cara menjadwalkan pemberitahuan petak peta
- Cara menyiapkan pemberitahuan berkala untuk petak peta
- Skema XML petak peta
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk