From fe2aa4880d5c9fd88088ad0ed81ebaca05629f5f Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 17:59:45 +0800
Subject: [PATCH] feat: 集成CAN驱动/模拟器 + 仪器仪表注册/硬件调试模块
---
Util.ManualDebug/StatusBtn.xaml.cs | 44 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/Util.ManualDebug/StatusBtn.xaml.cs b/Util.ManualDebug/StatusBtn.xaml.cs
index 11c2783..ce40f51 100644
--- a/Util.ManualDebug/StatusBtn.xaml.cs
+++ b/Util.ManualDebug/StatusBtn.xaml.cs
@@ -1,8 +1,9 @@
-锘縰sing CommunityToolkit.Mvvm.ComponentModel;
+锘縰sing 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)
{
--
Gitblit v1.9.1