0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 09:30:45 -05:00
loyvsc 441fb128fe Implement NotifyPropertyChangedBase, optimization (!66)
- 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>
2024-09-02 07:53:58 +00:00

44 lines
973 B
C#

/* MenuBarItem.cs
* License: NCSA Open Source License
*
* Copyright: SPT
* AUTHORS:
* waffle.lord
*/
using System;
using System.ComponentModel;
using System.Threading.Tasks;
using SPT.Launcher.Utilities;
namespace SPT.Launcher.Models.Launcher
{
public class MenuBarItem : NotifyPropertyChangedBase
{
private string _name;
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
}
private bool _isSelected;
public bool IsSelected
{
get => _isSelected;
set => SetProperty(ref _isSelected, value);
}
private Action _itemAction;
public Action ItemAction
{
get => _itemAction;
set => SetProperty(ref _itemAction, value);
}
public Func<Task<bool>> CanUseAction = async () => await Task.FromResult(true);
public Action OnFailedToUseAction = null;
}
}