0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 08:30:44 -05:00
launcher/project/SPT.Launcher/ViewModels/Notifications/SPTNotificationViewModel.cs

49 lines
1.5 KiB
C#
Raw Permalink Normal View History

2023-03-03 19:25:33 +00:00
using Avalonia.Controls.Notifications;
using Avalonia.Media;
using ReactiveUI;
2024-05-21 20:15:19 +01:00
namespace SPT.Launcher.ViewModels.Notifications
2023-03-03 19:25:33 +00:00
{
2024-05-21 20:15:19 +01:00
public class SPTNotificationViewModel : ViewModelBase
2023-03-03 19:25:33 +00:00
{
public string Title { get; set; }
public string Message { get; set; }
public IBrush BarColor { get; set; }
2024-05-21 20:15:19 +01:00
public SPTNotificationViewModel(IScreen Host, string Title, string Message, NotificationType Type = NotificationType.Information) : base(Host)
2023-03-03 19:25:33 +00:00
{
this.Title = Title;
this.Message = Message;
switch(Type)
{
case NotificationType.Information:
{
BarColor = new SolidColorBrush(Colors.DodgerBlue);
break;
}
case NotificationType.Warning:
{
BarColor = new SolidColorBrush(Colors.Gold);
break;
}
case NotificationType.Success:
{
BarColor = new SolidColorBrush(Colors.ForestGreen);
break;
}
case NotificationType.Error:
{
BarColor = new SolidColorBrush(Colors.IndianRed);
break;
}
default:
{
BarColor = new SolidColorBrush(Colors.Gray);
break;
}
}
}
}
}