For use:
- Add style in App.xaml
<Application.Styles>
...
<StyleInclude Source="avares://GamerVII.Notification.Avalonia/Themes/Generic.xaml" />
</Application.Styles>
- Add notification panel in your window
<Border Grid.Column="1">
<controls:NotificationMessageContainer Manager="{Binding Manager}" />
</Border>- Bind manager from vm
public INotificationMessageManager Manager { get; } = new NotificationMessageManager();- 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().WithDelay(TimeSpan.FromSeconds(5))
.Queue();or
this.Manager
.CreateMessage(true, "#D03E3E", "Ошибка", "Укажите наименование клиента" )
.Dismiss().WithDelay(TimeSpan.FromSeconds(2))
.Queue();