c#消息信息框, 可自动关闭. 类似web信息框,开源组件ToastNotifications
By
admin
at 7 天前 • 0人收藏 • 46人看过
开源地址: https://github.com/rafallopatka/ToastNotifications
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);
2 个回复 | 最后更新于 5 天前

zhlzhang
6 天前
#1
登录后方可回帖