mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 01:16:17 +08:00
60 lines
1.3 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|