Ionite
10 months ago
3 changed files with 52 additions and 1 deletions
@ -0,0 +1,20 @@
|
||||
using System; |
||||
using Avalonia.Controls.Notifications; |
||||
using StabilityMatrix.Core.Models.Settings; |
||||
|
||||
namespace StabilityMatrix.Avalonia.Extensions; |
||||
|
||||
public static class NotificationLevelExtensions |
||||
{ |
||||
public static NotificationType ToNotificationType(this NotificationLevel level) |
||||
{ |
||||
return level switch |
||||
{ |
||||
NotificationLevel.Information => NotificationType.Information, |
||||
NotificationLevel.Success => NotificationType.Success, |
||||
NotificationLevel.Warning => NotificationType.Warning, |
||||
NotificationLevel.Error => NotificationType.Error, |
||||
_ => throw new ArgumentOutOfRangeException(nameof(level), level, null) |
||||
}; |
||||
} |
||||
} |
Loading…
Reference in new issue