diff --git a/src/MaaWpfGui/Utilities/PropertyDependsOnHelper.cs b/src/MaaWpfGui/Utilities/PropertyDependsOnUtility.cs similarity index 98% rename from src/MaaWpfGui/Utilities/PropertyDependsOnHelper.cs rename to src/MaaWpfGui/Utilities/PropertyDependsOnUtility.cs index c678701fcc..ec698c0b1d 100644 --- a/src/MaaWpfGui/Utilities/PropertyDependsOnHelper.cs +++ b/src/MaaWpfGui/Utilities/PropertyDependsOnUtility.cs @@ -1,4 +1,4 @@ -// +// // Part of the MaaWpfGui project, maintained by the MaaAssistantArknights team (Maa Team) // Copyright (C) 2021-2025 MaaAssistantArknights Contributors // @@ -26,7 +26,7 @@ namespace MaaWpfGui.Utilities; /// 提供对 PropertyDependsOnAttribute 的支持:当源属性改变时,自动通知依赖的属性。 /// 这是一个静态工具类,可以被 ViewModel 和 Screen 使用。 /// -public static class PropertyDependsOnHelper +public static class PropertyDependsOnUtility { // 存储每个实例的属性依赖关系:使用 ConditionalWeakTable 避免内存泄漏 private static readonly ConditionalWeakTable>> _instanceDependencies = []; @@ -172,3 +172,4 @@ public static class PropertyDependsOnHelper Log.Warning("类型 {Type} 的属性 {PropertyName} 需要通知变更,但未找到 NotifyOfPropertyChange 方法", type.FullName, propertyName); } } + diff --git a/src/MaaWpfGui/ViewModels/LogCardViewModel.cs b/src/MaaWpfGui/ViewModels/LogCardViewModel.cs index 45903b06ab..738b91928a 100644 --- a/src/MaaWpfGui/ViewModels/LogCardViewModel.cs +++ b/src/MaaWpfGui/ViewModels/LogCardViewModel.cs @@ -40,7 +40,7 @@ namespace MaaWpfGui.ViewModels public LogCardViewModel() { - PropertyDependsOnHelper.InitializePropertyDependencies(this); + PropertyDependsOnUtility.InitializePropertyDependencies(this); // Keep StartTime/EndTime in sync when Items changes or an item's Time updates. Items.CollectionChanged += Items_CollectionChanged; diff --git a/src/MaaWpfGui/ViewModels/LogItemViewModel.cs b/src/MaaWpfGui/ViewModels/LogItemViewModel.cs index 7c017bf45b..e2b154f203 100644 --- a/src/MaaWpfGui/ViewModels/LogItemViewModel.cs +++ b/src/MaaWpfGui/ViewModels/LogItemViewModel.cs @@ -38,7 +38,7 @@ public class LogItemViewModel : PropertyChangedBase /// The toolTip public LogItemViewModel(string content, string color = UiLogColor.Message, string weight = "Regular", string dateFormat = "", bool showTime = true, ToolTip? toolTip = null) { - PropertyDependsOnHelper.InitializePropertyDependencies(this); + PropertyDependsOnUtility.InitializePropertyDependencies(this); if (string.IsNullOrEmpty(dateFormat)) { diff --git a/src/MaaWpfGui/ViewModels/TaskViewModel.cs b/src/MaaWpfGui/ViewModels/TaskViewModel.cs index 70ac052173..354ec3b25b 100644 --- a/src/MaaWpfGui/ViewModels/TaskViewModel.cs +++ b/src/MaaWpfGui/ViewModels/TaskViewModel.cs @@ -33,7 +33,7 @@ public abstract class TaskViewModel : PropertyChangedBase { protected TaskViewModel() { - PropertyDependsOnHelper.InitializePropertyDependencies(this); + PropertyDependsOnUtility.InitializePropertyDependencies(this); } protected T? GetTaskConfig()