using System; using System.Reactive; using Avalonia.Collections; using ReactiveUI; namespace detect.gui.Models; public class RegionModel : ReactiveObject { private long? _id; public long? Id { get => _id; set => this.RaiseAndSetIfChanged(ref _id, value); } private string? _name; public string? Name { get => _name; set => this.RaiseAndSetIfChanged(ref _name, value); } private string? _code; public string? Code { get => _code; set => this.RaiseAndSetIfChanged(ref _code, value); } private DateTime? _createTime; public DateTime? CreateTime { get => _createTime; set => this.RaiseAndSetIfChanged(ref _createTime, value); } private DateTime? _updateTime; public DateTime? UpdateTime { get => _updateTime; set => this.RaiseAndSetIfChanged(ref _updateTime, value); } private AvaloniaList _deviceList = []; public AvaloniaList DeviceList { get => _deviceList; set => this.RaiseAndSetIfChanged(ref _deviceList, value); } private bool _isExpand; public bool IsExpand { get => _isExpand; set => this.RaiseAndSetIfChanged(ref _isExpand, value); } public ReactiveCommand ExpandCommand { get; } public RegionModel() { ExpandCommand = ReactiveCommand.Create(() => IsExpand = !IsExpand); } }