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.
72 lines
1.5 KiB
72 lines
1.5 KiB
|
2 months ago
|
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 object? _content;
|
||
|
|
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>
|
||
|
|
/// 标签页内容
|
||
|
|
/// </summary>
|
||
|
|
public object? Content
|
||
|
|
{
|
||
|
|
get => _content;
|
||
|
|
set => this.RaiseAndSetIfChanged(ref _content, 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;
|
||
|
|
}
|