mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-13 09:50:43 -05:00
- NotifyPropertyChangedBase created and implemented in classes that inherit INotifyPropertyChangedBase - Some optimization fixes in models (one of this - `Where(predicate).Count() == 0` to `All(invertedPredicate)` Co-authored-by: Valery Varaksa <varaksav62@gmail.com> Reviewed-on: SPT/Launcher#66 Co-authored-by: loyvsc <loyvsc@noreply.dev.sp-tarkov.com> Co-committed-by: loyvsc <loyvsc@noreply.dev.sp-tarkov.com>
57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
/* NotificationItem.cs
|
|
* License: NCSA Open Source License
|
|
*
|
|
* Copyright: SPT
|
|
* AUTHORS:
|
|
* waffle.lord
|
|
*/
|
|
|
|
|
|
using System;
|
|
using System.ComponentModel;
|
|
using SPT.Launcher.Utilities;
|
|
|
|
namespace SPT.Launcher.Models.Launcher.Notifications
|
|
{
|
|
public class NotificationItem : NotifyPropertyChangedBase
|
|
{
|
|
private string _message;
|
|
public string Message
|
|
{
|
|
get => _message;
|
|
set => SetProperty(ref _message, value);
|
|
}
|
|
|
|
private string _buttonText;
|
|
public string ButtonText
|
|
{
|
|
get => _buttonText;
|
|
set => SetProperty(ref _buttonText, value);
|
|
}
|
|
|
|
private bool _hasButton;
|
|
public bool HasButton
|
|
{
|
|
get => _hasButton;
|
|
set => SetProperty(ref _hasButton, value);
|
|
}
|
|
|
|
public Action ItemAction = null;
|
|
|
|
public NotificationItem(string message)
|
|
{
|
|
Message = message;
|
|
ButtonText = string.Empty;
|
|
HasButton = false;
|
|
}
|
|
|
|
public NotificationItem(string message, string buttonText, Action itemAction)
|
|
{
|
|
Message = message;
|
|
ButtonText = buttonText;
|
|
HasButton = true;
|
|
ItemAction = itemAction;
|
|
}
|
|
}
|
|
}
|