• Stars
    star
    136
  • Rank 266,385 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created over 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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