using ReactiveUI; using HeroIconsAvalonia.Enums; namespace MyAvaloniaApp.ViewModels; /// /// 标签页项模型 /// public class TabItem : ReactiveObject { private string _title = string.Empty; private IconType _iconType = IconType.Home; private object? _content; 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); } /// /// 标签页内容 /// public object? Content { get => _content; set => this.RaiseAndSetIfChanged(ref _content, 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; }