_______ _ _ _ _ _ __ _ _ _ ___
|__ __| | | | | | | | (_)/ _(_) | | (_) |__
| | ___ __ _ ___| |_| | | ___ | |_ _| |_ _ ___ __ _| |_ _ ___ _ __ ___ __ __ ) |
| |/ _ / _` / __| __| . ` |/ _ | __| | _| |/ __/ _` | __| |/ _ | '_ / __| / // /
| | (_) | (_| __ |_| | | (_) | |_| | | | | (_| (_| | |_| | (_) | | | __ V // /_
|_|___/ __,_|___/__|_| _|___/ __|_|_| |_|_____,_|__|_|___/|_| |_|___/ _/|____|
ToastNotification memungkinkan Anda untuk membuat dan menampilkan pemberitahuan yang kaya dalam aplikasi WPF. Ini sangat dapat dikonfigurasi dengan set opsi bawaan seperti posisi, perilaku, tema, dan banyak lainnya. Ini dapat diperpanjang, memberi Anda kemungkinan untuk membuat pemberitahuan khusus dan interaktif dengan cara yang sama.
Kode contoh
Toastnotifications dan ToastNotifications.Messages
Install-Package ToastNotifications
Install-Package ToastNotifications.Messages
ToastNotification V2 berorientasi plugin.
Nugget "ToastNotification" adalah inti, yang hanya berisi mekanisme utama untuk membuat dan menampilkan pemberitahuan. Pesan yang telah ditentukan sebelumnya dan fungsionalitas lain bukan utama disediakan oleh nugget terpisah.
Nugget ToastNotifications.Messages berisi pesan dasar seperti kesalahan, informasi, peringatan, kesuksesan. Itu tidak diperlukan jika Anda ingin membuat pesan sendiri.
< Application .Resources>
< ResourceDictionary >
< ResourceDictionary .MergedDictionaries>
< ResourceDictionary Source = " pack://application:,,,/ToastNotifications.Messages;component/Themes/Default.xaml " />
</ ResourceDictionary .MergedDictionaries>
</ ResourceDictionary >
</ Application .Resources> using ToastNotifications ;
using ToastNotifications . Lifetime ;
using ToastNotifications . Position ;
/* * */
Notifier notifier = new Notifier ( cfg =>
{
cfg . PositionProvider = new WindowPositionProvider (
parentWindow : Application . Current . MainWindow ,
corner : Corner . TopRight ,
offsetX : 10 ,
offsetY : 10 ) ;
cfg . LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor (
notificationLifetime : TimeSpan . FromSeconds ( 3 ) ,
maximumNotificationCount : MaximumNotificationCount . FromCount ( 5 ) ) ;
cfg . Dispatcher = Application . Current . Dispatcher ;
} ) ; using ToastNotifications . Messages ;
/* * */
notifier . ShowInformation ( message ) ;
notifier . ShowSuccess ( message ) ;
notifier . ShowWarning ( message ) ;
notifier . ShowError ( message ) ; /* * */
notifier . Dispose ( ) ; Catatan Relesae Catatan Catatan, deskripsi fitur baru, perbaikan bug, dan perubahan yang melanggar.
Meningkatkan dari V1 ToastNotification V2 adalah implementasi yang benar -benar baru dan tidak kompatibil dengan versi 1, ikuti instruksi migrasi untuk meningkatkan ke versi baru.
Konfigurasi ToastNotification V2 memiliki banyak opsi konfigurasi untuk posisinya, seumur hidup, pesan dan banyak lainnya, dokumen ini menggambarkan semuanya.
Membuat Pemberitahuan Kustom Dokumen ini menjelaskan cara membuat pemberitahuan Anda sendiri.
Majelis yang sangat dinamai ToastNotifications V2 Assembies ditandatangani. Baca dokumen ini untuk detail lebih lanjut.
Andy Li (https://github.com/onathy)
B. Micka (https://github.com/b-mi)
Cuiliang (https://github.com/cuiliang)
Braincrumbz (https://github.com/braincrumbz)
Fischjoghurt (https://github.com/fischjoghurt)
Francois Botha Igitur (https://github.com/igitur)
Jan M. (https://github.com/pantheas)
Johannes Jidel (https://github.com/jidel)
Kostiantyn (https://github.com/dualbios)
Krzysztof Zmorzyński (https://github.com/zmorzynskik)
Robin Krom Lakritzator (https://github.com/lakritzator)
UWY (https://github.com/uwy)
William David Cossey (https://github.com/wdcossey)
Sebelum Anda membuat masalah baru, silakan periksa dokumentasi, karena banyak fitur dan opsi sudah ada. (https://github.com/raflop/toastnotifications/tree/master-v2/docs)
Jika masih ada masalah, silakan buat masalah baru/pertanyaan mengisi informasi berikut. Jika memungkinkan, berikan kode sampel untuk mereproduksi masalah.