_______ _ _ _ _ _ __ _ _ _ ___
|__ __| | | | | | | | (_)/ _(_) | | (_) |__
| | ___ __ _ ___| |_| | | ___ | |_ _| |_ _ ___ __ _| |_ _ ___ _ __ ___ __ __ ) |
| |/ _ / _` / __| __| . ` |/ _ | __| | _| |/ __/ _` | __| |/ _ | '_ / __| / // /
| | (_) | (_| __ |_| | | (_) | |_| | | | | (_| (_| | |_| | (_) | | | __ V // /_
|_|___/ __,_|___/__|_| _|___/ __|_|_| |_|_____,_|__|_|___/|_| |_|___/ _/|____|
ToastNotifications允許您在WPF應用程序中創建和顯示豐富的通知。它具有高度可配置的,具有一組內置選項,例如位置,行為,主題和許多其他選項。它是可擴展的,它使您有可能簡單地創建自定義和交互式通知。
示例代碼
吐司和吐司
Install-Package ToastNotifications
Install-Package ToastNotifications.Messages
ToastNotifications V2面向插件。
掘金“ ToastNotifications”是一個核心,它僅包含創建和顯示通知的主要機制。預定義的消息和其他非關鍵功能由單獨的掘金提供。
掘金toastnotification.messages包含錯誤,信息,警告,成功等基本消息。如果您要創建自己的消息,則不需要。
< 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 ( ) ; Relsae Notes發行說明,新功能的描述,錯誤修復和破壞更改。
從V1 toastnotification V2升級是全新的實現,並且與版本1不兼容,請按照遷移說明昇級到新版本。
配置Toastnotification V2具有許多配置選項,可用於其位置,壽命,消息和許多其他配置選項,本文檔將其全部描述。
創建自定義通知本文檔描述瞭如何創建自己的通知。
簽署了強烈命名的組件吐司v2組件。閱讀此文檔以獲取更多詳細信息。
Andy Li(https://github.com/oneandy)
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)
約翰內斯·吉德爾(https://github.com/jidel)
Kostiantyn(https://github.com/dualbios)
KrzysztofZmorzyński(https://github.com/zmorzynskik)
Robin Krom Lakritzator(https://github.com/lakritzator)
uwy(https://github.com/uwy)
威廉·戴維·科西(William David Cossey)(https://github.com/wdcossey)
在創建新問題之前,請檢查文檔,因為許多功能和選項已經存在。 (https://github.com/raflop/toastnotifications/tree/master-v2/docs)
如果仍然存在問題,請創建新的問題/問題以下信息。如果可能的話,請提供示例代碼以復制問題。