AppNotificationButton.SetContextMenuPlacement 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.
Meminta agar tombol pemberitahuan aplikasi ditempatkan di menu konteks pemberitahuan.
public:
virtual AppNotificationButton ^ SetContextMenuPlacement() = SetContextMenuPlacement;
AppNotificationButton SetContextMenuPlacement();
public AppNotificationButton SetContextMenuPlacement();
function setContextMenuPlacement()
Public Function SetContextMenuPlacement () As AppNotificationButton
Mengembalikan
Mengembalikan instans AppNotificationButton sehingga panggilan metode tambahan dapat ditautkan.
Contoh
Contoh berikut menunjukkan penggunaan metode ini untuk mengatur penempatan menu konteks untuk tombol pemberitahuan aplikasi.
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.AddButton(new AppNotificationButton("Reply")
.AddArgument("action", "reply")
.SetContextMenuPlacement())
.BuildNotification();
AppNotificationManager.Default.Show(notification);
Payload XML yang dihasilkan jika skenario mendesak didukung:
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Notification text.</text>
</binding>
</visual>
<actions>
<action content='Reply' arguments='action=reply' placement='contextMenu'/>
</actions>
</toast>
Keterangan
Anda juga dapat mengatur nilai penempatan menu konteks dengan properti AppNotificationButton.ContextMenuPlacement .
Untuk panduan tentang menggunakan API AppNotificationBuilder untuk membuat pemberitahuan UI forapp, lihat Konten pemberitahuan aplikasi.
Untuk informasi referensi tentang skema XML untuk pemberitahuan aplikasi, lihat skema konten pemberitahuan aplikasi .