ToastManager is a simple C# library for displaying customizable toast notifications or views as overlay in WPF (Windows Presentation Foundation) applications.
Install the ToastManager.WPF NuGet package :
Install-Package ToastManager.WPF
// Show a warning toast
ToastManager.ShowWarningToast("This is a warning message");
// Show an error toast
ToastManager.ShowErrorToast("An error occurred");
// Show a success toast
ToastManager.ShowSuccessToast("Operation successful");
// Show an info toast
ToastManager.ShowInfoToast("Information message");
// Show a custom toast
ToastManager.ShowToast("Custom message", "Custom Title", ToastType.Info, ToastButton.Yes | ToastButton.No);
// Bring a custom control as toast
var toastView = new MyView();
ToastManager.ShowToast(toastView);
You can handle actions like button clicks or toast dismissal in your ViewModel:
var toastView = new Toast_View(message, title, toastType, toastButton);
toastView.OnOkButtonClick += () => foo();
toastView.OnYesButtonClick += () => foo();
toastView.OnNoButtonClick += () => foo();
toastView.OnCancelButtonClick += () => foo();
toastView.OnExitButtonClick += () => foo();
Customize the appearance and behavior of toast views by modifying the template of the ToastDialog.xaml UserControl provided in the library.
Contributions are welcome!
Inspired by the need for simple and dynamic toast notifications in WPF applications. Elevate your user interface with ToastManager !