Files
SteamTools/System.Application.SteamTools.Client.Desktop/UI/ViewModels/Base/TabItemViewModel.cs
T
2021-03-02 04:51:43 +08:00

60 lines
1.3 KiB
C#

using ReactiveUI;
using StatefulModel.EventListeners;
using System.Application.UI.Resx;
using System.Threading.Tasks;
namespace System.Application.UI.ViewModels
{
public abstract class TabItemViewModel : ItemViewModel
{
#region Name 変更通知
public abstract string Name { get; protected set; }
#endregion
#region Badge 変更通知
private int? _Badge;
public virtual int? Badge
{
get => _Badge;
protected set => this.RaiseAndSetIfChanged(ref _Badge, value);
}
#endregion
#region Status 変更通知
private ViewModelBase? _Status;
/// <summary>
/// 获取状态栏中显示的状态
/// </summary>
public virtual ViewModelBase? Status
{
get => _Status;
protected set => this.RaiseAndSetIfChanged(ref _Status, value);
}
#endregion
protected TabItemViewModel()
{
if (IsInDesignMode) return;
this.CompositeDisposable?.Add(new PropertyChangedEventListener(R.Current)
{
(sender, args) => this.RaisePropertyChanged(nameof(this.Name)),
});
}
internal async virtual Task Initialize()
{
await Task.CompletedTask;
}
}
}