mcpField
S
syncfusion-wpf-toast-notification

syncfusion-wpf-toast-notification

github.com/syncfusionDevelopment5159 installsUpdated 1w ago
Repository

About syncfusion-wpf-toast-notification

A skill guide for implementing Syncfusion’s SfToastNotification in WPF. It covers native Windows notifications and in-app toasts, including severity, placement, grouping, and actions.

Key features

  1. 01Native, window, and screen display modes
  2. 02Severity-based visual styles
  3. 03Automatic dismissal and animations
  4. 04Interactive action buttons
  5. 05Toast grouping and custom placement

Use cases

  1. 01Show save and operation status messages
  2. 02Display errors with retry or dismiss actions
  3. 03Present grouped notifications in WPF windows

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/wpf-ui-components-skills --skill syncfusion-wpf-toast-notification

After installing, type/syncfusion-wpf-toast-notificationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
action-buttons.md
custom-positioning.md
custom-spacing.md
display-modes.md
getting-started.md
placement-and-animations.md
severity-and-variants.md
template-customization.md
toast-grouping.md

Details

From the project README

Implementing Toast Notifications in WPF

When to Use This Skill

Use this skill whenever the user needs to:

  • Display temporary, non-intrusive notifications in WPF applications
  • Show status messages (save successful, operation completed, errors)
  • Implement notification alerts that auto-dismiss after a timeout
  • Create native Windows OS notifications or custom in-app toasts
  • Display severity-based messages (Info, Success, Warning, Error)
  • Add interactive action buttons to notifications (Reply, Undo, OK)
  • Show transient feedback that doesn't block user workflow
  • Implement global or window-scoped notifications
  • Group related notifications using a unique Group ID for better organization
  • Display toasts at custom screen positions for flexible notification placement
  • Customize spacing between toasts for tailored notification layout

Component Overview

SfToastNotification is a non-UI control (no XAML required) that displays toast notifications in WPF applications. It supports three display modes:

  • Default Mode: Native Windows OS notifications (Windows 10+)
  • Window Mode: In-app notifications constrained to window boundaries
  • Screen Mode: Global overlay notifications across the screen

Key Characteristics:

  • Code-only implementation (no XAML markup needed)
  • Static API for showing/closing toasts
  • Multiple severity levels with built-in visual styling
  • Customizable animations, placement, and templates
  • Interactive action buttons with callbacks
  • Full template customization support

Documentation and Navigation Guide

Reference Files

Quick Start Example

Basic Information Toast
using System.Windows;
using Syncfusion.UI.Xaml.SfToastNotification;

namespace ToastDemo
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void ShowToast_Click(object sender, RoutedEventArgs e)
        {
            // Simple toast with title and message
            SfToastNotification.Show(this, new ToastOptions
            {
                Mode = ToastMode.Screen,
                Title = "Welcome",
                Message = "Hello! This is your first toast notification."
            });
        }
    }
}
Error Toast with Action Buttons
// Error toast with Retry and Dismiss actions
SfToastNotification.Show(this, new ToastOptions
{
    Title = "Operation Failed",
    Message = "Unable to save your changes. Please try again.",
    Severity = ToastSeverity.Error,
    Mode = ToastMode.Screen,
    Actions = new List<ToastAction>
    {
        new ToastAction("Retry")
        {
            Callback = () => RetryOperation(),
            CloseOnClick = true
        },
        new ToastAction("Dismiss")
        {
            CloseOnClick = true
        }
    }
});

Common Patterns

Native OS Notification

Initialize at startup via WindowsToastBootstrapper.Initialize(), then set Mode = ToastMode.Default.


Key Properties

  • Title: Bold text at top (string)
  • Message: Main body text (string)
  • Mode: Display mode - Default (native OS), Window, or Screen
  • Severity: Visual severity - None, Info, Success, Warning, Error
  • Duration: Auto-close timeout (default: 6 seconds)
  • PreventAutoClose: Disable auto-close (bool)
  • Placement: Screen position (8 options: TopLeft, TopCenter, etc.)
  • Variant: Visual variant - Text, Outlined, Filled
  • AccentBrush: Custom color accent (Brush)
  • ShowAnimationType: Show animation (FadeIn, Zoom, Slide, Flip, etc.)
  • CloseAnimationType: Hide animation (FadeOut, etc.)
  • Actions: Interactive action buttons (List)
  • Id: Unique identifier for management (string)
  • GroupName: Group ID for organizing related notifications (string)
  • HorizontalOffset: Horizontal adjustment from placement (double)
  • VerticalOffset: Vertical adjustment from placement (double)
  • X: Absolute horizontal position from left edge when using Custom placement (double)
  • Y: Absolute vertical position from top edge when using Custom placement (double)
  • Spacing: Custom spacing between toasts in the corner (double)
  • EnableGroupView: Enable grouped notification display (bool)
  • GroupContainerHeader: Custom header text for grouped notifications (string)

Comments

Markdown supported