Home

Awesome

Notification.Avalonia

Port of this repo


To start you should install NuGet package

Install-Package Notification.Avalonia

nuget or download https://www.nuget.org/packages/Notification.Avalonia/ repo.



For use:

  1. Add style in App.xaml
<Application.Styles>
        ...
    <StyleInclude Source="avares://Notification.Avalonia/Themes/Generic.xaml" />
</Application.Styles>

  1. Add notification panel in your window
 <Border Grid.Column="1">
       <controls:NotificationMessageContainer Manager="{Binding Manager}" />
 </Border>
  1. Bind manager from vm
 public INotificationMessageManager Manager { get; } = new NotificationMessageManager();
  1. Run notification
            this.Manager
                .CreateMessage()
                .Accent("#1751C3")
                .Animates(true)
                .Background("#333")
                .HasBadge("Info")
                .HasMessage(
                    "Update will be installed on next application restart. This message will be dismissed after 5 seconds.")
                .Dismiss().WithButton("Update now", button => { })
                .Dismiss().WithButton("Release notes", button => { })
                .Dismiss().WithDelay(TimeSpan.FromSeconds(5))
                .Queue();