_______ _ _ _ _ _ __ _ _ _ ___
|__ __| | | | | | | | (_)/ _(_) | | (_) |__
| | ___ __ _ ___| |_| | | ___ | |_ _| |_ _ ___ __ _| |_ _ ___ _ __ ___ __ __ ) |
| |/ _ / _` / __| __| . ` |/ _ | __| | _| |/ __/ _` | __| |/ _ | '_ / __| / // /
| | (_) | (_| __ |_| | | (_) | |_| | | | | (_| (_| | |_| | (_) | | | __ 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)
如果仍然存在问题,请创建新的问题/问题以下信息。如果可能的话,请提供示例代码以复制问题。