2023-03-03 19:25:33 +00:00
|
|
|
|
/* MenuBarItem.cs
|
|
|
|
|
* License: NCSA Open Source License
|
|
|
|
|
*
|
2024-05-21 20:15:19 +01:00
|
|
|
|
* Copyright: SPT
|
2023-03-03 19:25:33 +00:00
|
|
|
|
* AUTHORS:
|
|
|
|
|
* waffle.lord
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Threading.Tasks;
|
2024-09-02 07:53:58 +00:00
|
|
|
|
using SPT.Launcher.Utilities;
|
2023-03-03 19:25:33 +00:00
|
|
|
|
|
2024-05-21 20:15:19 +01:00
|
|
|
|
namespace SPT.Launcher.Models.Launcher
|
2023-03-03 19:25:33 +00:00
|
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
|
public class MenuBarItem : NotifyPropertyChangedBase
|
2023-03-03 19:25:33 +00:00
|
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
|
private string _name;
|
2023-03-03 19:25:33 +00:00
|
|
|
|
public string Name
|
|
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
|
get => _name;
|
|
|
|
|
set => SetProperty(ref _name, value);
|
2023-03-03 19:25:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-09-02 07:53:58 +00:00
|
|
|
|
private bool _isSelected;
|
2023-03-03 19:25:33 +00:00
|
|
|
|
public bool IsSelected
|
|
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
|
get => _isSelected;
|
|
|
|
|
set => SetProperty(ref _isSelected, value);
|
2023-03-03 19:25:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-09-02 07:53:58 +00:00
|
|
|
|
private Action _itemAction;
|
2023-03-03 19:25:33 +00:00
|
|
|
|
public Action ItemAction
|
|
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
|
get => _itemAction;
|
|
|
|
|
set => SetProperty(ref _itemAction, value);
|
2023-03-03 19:25:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Func<Task<bool>> CanUseAction = async () => await Task.FromResult(true);
|
|
|
|
|
|
|
|
|
|
public Action OnFailedToUseAction = null;
|
|
|
|
|
}
|
|
|
|
|
}
|