All Projects → Enterwell → Wpf.notifications

Enterwell / Wpf.notifications

Licence: mit
WPF notifications UI controls (as seen in VS Code)

Projects that are alternatives of or similar to Wpf.notifications

Toastnotifications
Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.
Stars: ✭ 507 (+59.43%)
Mutual labels:  notifications, wpf
Webpush
webpush, Encryption Utilities for Web Push protocol
Stars: ✭ 308 (-3.14%)
Mutual labels:  notifications
Elmish.wpf
Static WPF views for elmish programs.
Stars: ✭ 287 (-9.75%)
Mutual labels:  wpf
Simple Music Player
Simple Music Player - SimpleMP - Keeps it simple and plays your music
Stars: ✭ 298 (-6.29%)
Mutual labels:  wpf
Ftindicator
A light wight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes support.
Stars: ✭ 292 (-8.18%)
Mutual labels:  notifications
Gitify
GitHub notifications on your menu bar. Available on macOS, Windows & Linux.
Stars: ✭ 3,543 (+1014.15%)
Mutual labels:  notifications
C Compiler
C--compiler which implements LL(1)\LR(0)\SLR\LR(1) and semantic analysis and MIPS generate
Stars: ✭ 286 (-10.06%)
Mutual labels:  wpf
Sde
Swift Development Environment based on VS Code
Stars: ✭ 311 (-2.2%)
Mutual labels:  vscode
Wintoast
WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8 & Windows 10. Toast notifications allows your app to inform the users about relevant information and timely events that they should see and take action upon inside your app, such as a new instant message, a new friend request, breaking news, or a calendar event.
Stars: ✭ 307 (-3.46%)
Mutual labels:  notifications
Ismessages
This is simple extension for presenting system-wide notifications from top/bottom of device screen.
Stars: ✭ 299 (-5.97%)
Mutual labels:  notifications
Vscode Winddown
VS Code extension that encourages you to take a break.
Stars: ✭ 299 (-5.97%)
Mutual labels:  vscode
Vscode Solargraph
A Visual Studio Code extension for Solargraph.
Stars: ✭ 292 (-8.18%)
Mutual labels:  vscode
Glnotificationbar
GLNotificationBar is a ios10 style notification bar, can be used to handle push notification in active state.
Stars: ✭ 306 (-3.77%)
Mutual labels:  notifications
Playnite
Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
Stars: ✭ 3,608 (+1034.59%)
Mutual labels:  wpf
Graphql Starter
💥 Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, Relay, and Material UI.
Stars: ✭ 3,377 (+961.95%)
Mutual labels:  vscode
Imt Wanke Client
不朽玩客云客户端(Immortalt Wanke Client)
Stars: ✭ 286 (-10.06%)
Mutual labels:  wpf
Vscode Reveal
Revealjs vsCode extension
Stars: ✭ 298 (-6.29%)
Mutual labels:  vscode
Xamarin Forms Tab Badge
Xamarin Forms bindable Tab badges for iOS, Android, UWP, MacOS and WPF
Stars: ✭ 304 (-4.4%)
Mutual labels:  wpf
Sharpvectors
SharpVectors - SVG# Reloaded: SVG DOM and Rendering in C# for the .Net.
Stars: ✭ 315 (-0.94%)
Mutual labels:  wpf
Nb
CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
Stars: ✭ 3,846 (+1109.43%)
Mutual labels:  vscode

Enterwell Client WPF - Notifications

WPF notifications UI controls

NuGet version

Features

  • Flexible styling
  • MVVM friendly
  • LINQ like syntax

Installation

Install from nuget.org feed:

Install-Package Enterwell.Clients.Wpf.Notifications

Basics

NotificationMessage is the notification UI control. Three main parts are - badge, located on the most left, message in the center and buttons on the right for user interaction.

NotificationMessageButton is button control for user interaction with the notification.

You can instantiate these controls manually or use NotificationMessageFactory that will do this for you.

The factory is used by notification message manager - NotificationMessageManager which is responsible for queueing and dismissing notifications.

The UI control that provides support for multiple notifications is NotificationMessageContainer. This control can be placed in the main window, and it needs manager to be assigned. It will then handle all notification queue/dismiss operations for you.

Basic usage

In your window XAML, place the NotificationMessageContainer control. You can bind the manager to your view model and obtain the manager via DI or some other mechanism; or you can just assign the manager instance from the backend.

this.Manager = new NotificationMessageManager();
<controls:NotificationMessageContainer Manager="{Binding Manager}" />

Simple "info" notification

Info notification message

manager.CreateMessage()
       .Accent("#1751C3")
       .Background("#333")
       .HasBadge("Info")
       .HasMessage("Update will be installed on next application restart.")
       .Dismiss().WithButton("Update now", button => { })
       .Dismiss().WithButton("Release notes", button => { })
       .Dismiss().WithButton("Later", button => { })
       .Queue(); 

CreateMessage on manager creates an empty notification message. We then set the accent and background brushes. HasBadge and HasMessage will populate the notification badge and message content.

WithButton will create a button with the specified content (content doesn't have to be string) and specified action callback when clicked. If you place Dismiss before WithButton, your button callback will be intercepted by dismiss notification action first - the notification will be dismissed on user input.

Queue will enqueue the message. This will propagate the message to notification message container control which will then show the message (when multiple messages are displayed, new messages are queued to bottom of the stack)

Simple "warning" notification

Warning notification message

manager.CreateMessage()
       .Accent("#E0A030")
       .Background("#333")
       .HasBadge("Warn")
       .HasMessage("Failed to retrieve data.")
       .WithButton("Try again", button => { })
       .Dismiss().WithButton("Ignore", button => { })
       .Queue();

Enable notification message animations (opt-in feature)

manager
    ...
    .Animates(true)
    .AnimationInDuration(0.75)
    .AnimationOutDuration(2)
    ...

Advanced usage

Custom control overlay notification

Error notification message with progress bar overlay

manager.CreateMessage()
       .Accent("#F15B19")
       .Background("#F15B19")
       .HasHeader("Lost connection to server")
       .HasMessage("Reconnecting...")
       .WithOverlay(new ProgressBar
       {
           VerticalAlignment = VerticalAlignment.Bottom,
           HorizontalAlignment = HorizontalAlignment.Stretch,
           Height = 3,
           BorderThickness = new Thickness(0),
           Foreground = new SolidColorBrush(Color.FromArgb(128, 255, 255, 255)),
           Background = Brushes.Transparent,
           IsIndeterminate = true,
           IsHitTestVisible = false
       })
       .Queue();

The WithOverlay allows you to set custom overlay content. In this example a progress bar is placed on the bottom of notification control. Notice the IsHitTextVisible is set to false so that notification message buttons don't lose focus due to overlay control being over the bottom part of the buttons.

Custom additional content for notification

Notification message with additional content - checkbox at the bottom

manager.CreateMessage()
       .Accent("#1751C3")
       .Background("#333")
       .HasBadge("Info")
       .HasHeader("Update available")
       .HasMessage("Update will be installed on next application restart.")
       .Dismiss().WithButton("Update now", button => { })
       .Dismiss().WithButton("Later", button => { })
       .WithAdditionalContent(ContentLocation.Bottom,
       new Border
       {
           BorderThickness = new Thickness(0,1,0,0),
           BorderBrush = new SolidColorBrush(Color.FromArgb(128, 28, 28, 28)),
           Child = new CheckBox
           {
               Margin = new Thickness(12, 8, 12, 8),
               HorizontalAlignment = HorizontalAlignment.Left,
               Content = "Don't show again"
           }
       })
       .Queue();

In this example a custom "Don't show again" checkbox is located at the bottom of the message.

You can add additional content to following locations: Top, Bottom, Left, Right, Main, AboveBadge.

Multiple notification

The NotificationMessageContainer has build-in support for showing multiple notifications at the same time. New notifications will show at the bottom of the message stack.

Multiple notifications example

Don't like extension methods?

Extension methods don't hold any complex logic for instantiating notifications so you can still build the notification message using just NotificationMessageBuilder class directly, without extension methods.

var builder = NotificationMessageBuilder.CreateMessage();
builder.Manager = this.Manager;
builder.Message = this.Manager.Factory.GetMessage();
builder.SetAccent(Brushes.DodgerBlue);
builder.SetBackground(Brushes.DimGray);
builder.SetBadge("Info");
builder.HasMessage("This notification is built without extension methods.");

var notificationButton = this.Manager.Factory.GetButton();
notificationButton.Content = "This is much longer";
notificationButton.Callback = (button) =>
{
    this.Manager.Dismiss(builder.Message);
    // ... Do the rest
};

builder.AddButton(notificationButton);
builder.Manager.Queue(builder.Message);

Don't like the builder?

Standard control instantiation is supported too.

this.Manager.Queue(new NotificationMessage
{
    Message = "Works event without message builder",
    BadgeText = "Info",
    AccentBrush = Brushes.Orange,
    Background = Brushes.Black,
    Buttons = new ObservableCollection<object>
    {
        new NotificationMessageButton()
        {
            Content = "Great!",
            Callback = button => { }
        }
    }
});

XAML only? Supported too. You get the idea.

Development

Pack NuGet: nuget pack -Prop Configuration=Release

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].