You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.6 KiB
71 lines
1.6 KiB
using ReactiveUI;
|
|
using HeroIconsAvalonia.Enums;
|
|
|
|
namespace MyAvaloniaApp.ViewModels;
|
|
|
|
/// <summary>
|
|
/// 标签页项模型
|
|
/// </summary>
|
|
public class TabItem : ReactiveObject
|
|
{
|
|
private string _title = string.Empty;
|
|
private IconType _iconType = IconType.Home;
|
|
private IRoutableViewModel? _viewModel;
|
|
private bool _isSelected;
|
|
private bool _canClose = true;
|
|
|
|
/// <summary>
|
|
/// 标签页标题
|
|
/// </summary>
|
|
public string Title
|
|
{
|
|
get => _title;
|
|
set => this.RaiseAndSetIfChanged(ref _title, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 标签页图标类型
|
|
/// </summary>
|
|
public IconType IconType
|
|
{
|
|
get => _iconType;
|
|
set => this.RaiseAndSetIfChanged(ref _iconType, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 标签页的 ViewModel
|
|
/// </summary>
|
|
public IRoutableViewModel? ViewModel
|
|
{
|
|
get => _viewModel;
|
|
set => this.RaiseAndSetIfChanged(ref _viewModel, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 是否选中
|
|
/// </summary>
|
|
public bool IsSelected
|
|
{
|
|
get => _isSelected;
|
|
set => this.RaiseAndSetIfChanged(ref _isSelected, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 是否可以关闭
|
|
/// </summary>
|
|
public bool CanClose
|
|
{
|
|
get => _canClose;
|
|
set => this.RaiseAndSetIfChanged(ref _canClose, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 标签页标识符
|
|
/// </summary>
|
|
public string Id { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 标签页类型
|
|
/// </summary>
|
|
public string Type { get; set; } = string.Empty;
|
|
}
|
|
|