wenxiangchao
2026-11-02 fe2aa4880d5c9fd88088ad0ed81ebaca05629f5f
Util.ManualDebug/StatusBtn.xaml.cs
@@ -1,8 +1,9 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
namespace Util.SB
namespace Util.ManualDebug
{
    // 状态枚举
    public enum DebugStatus
@@ -15,9 +16,26 @@
    /// <summary>
    /// StatusBtn.xaml 的交互逻辑
    /// </summary>
    [ObservableObject]
    public partial class StatusBtn : UserControl
    public partial class StatusBtn : UserControl, INotifyPropertyChanged
    {
        #region ...
        public event PropertyChangedEventHandler PropertyChanged;
        protected void Set([CallerMemberName] string name = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
        }
        protected void Set<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
        {
            old = @new;
            if (propertyName != null)
            {
                Set(propertyName);
            }
        }
        #endregion
        public event RoutedEventHandler BtnClick;
        public StatusBtn()
@@ -26,11 +44,25 @@
            InitializeComponent();
        }
        [ObservableProperty]
        private string title = string.Empty;
        public string Title
        {
            get => title;
            set
            {
                Set(ref title, value);
            }
        }
        [ObservableProperty]
        private DebugStatus status = DebugStatus.Idle;
        public DebugStatus Status
        {
            get => status;
            set
            {
                Set(ref status, value);
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {