Skip to content

ToastManager is a lightweight C# library for displaying toast messages in desktop applications built with WPF

License

Notifications You must be signed in to change notification settings

V4SS3UR/ToastManager.WPF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToastManager

ToastManager is a simple C# library for displaying customizable toast notifications or views as overlay in WPF (Windows Presentation Foundation) applications.

Features

  • Toast Types: Display toast messages categorized as Warning, Error, Success, and Info.
  • Customization: Customize toast messages with different titles, messages, icons, and button configurations.
  • MVVM Support: Designed with MVVM architecture for seamless integration into WPF projects.
  • Responsive Design: Toasts are responsive and can adapt to any different style or template.
  • Flexibility: Display custom controls or views instead of traditional toast notifications for richer user experiences.

Installation

Install the ToastManager.WPF NuGet package :

Install-Package ToastManager.WPF

Usage

Display Toast Messages

// 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);

Display custom view

// Bring a custom control as toast
var toastView = new MyView();
ToastManager.ShowToast(toastView);

Handle Toast Actions

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 Toast Views

Customize the appearance and behavior of toast views by modifying the template of the ToastDialog.xaml UserControl provided in the library.

Contributing

Contributions are welcome!


Inspired by the need for simple and dynamic toast notifications in WPF applications. Elevate your user interface with ToastManager !

About

ToastManager is a lightweight C# library for displaying toast messages in desktop applications built with WPF

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages