using ReactiveUI;
using HeroIconsAvalonia.Enums;
namespace MyAvaloniaApp.ViewModels;
///
/// 标签页项模型
///
public class TabItem : ReactiveObject
{
private string _title = string.Empty;
private IconType _iconType = IconType.Home;
private IRoutableViewModel? _viewModel;
private bool _isSelected;
private bool _canClose = true;
///
/// 标签页标题
///
public string Title
{
get => _title;
set => this.RaiseAndSetIfChanged(ref _title, value);
}
///
/// 标签页图标类型
///
public IconType IconType
{
get => _iconType;
set => this.RaiseAndSetIfChanged(ref _iconType, value);
}
///
/// 标签页的 ViewModel
///
public IRoutableViewModel? ViewModel
{
get => _viewModel;
set => this.RaiseAndSetIfChanged(ref _viewModel, value);
}
///
/// 是否选中
///
public bool IsSelected
{
get => _isSelected;
set => this.RaiseAndSetIfChanged(ref _isSelected, value);
}
///
/// 是否可以关闭
///
public bool CanClose
{
get => _canClose;
set => this.RaiseAndSetIfChanged(ref _canClose, value);
}
///
/// 标签页标识符
///
public string Id { get; set; } = string.Empty;
///
/// 标签页类型
///
public string Type { get; set; } = string.Empty;
}