diff --git a/GFramework.Core/events/EasyEventGeneric.cs b/GFramework.Core/events/EasyEventGeneric.cs index ede45ba..07af5a1 100644 --- a/GFramework.Core/events/EasyEventGeneric.cs +++ b/GFramework.Core/events/EasyEventGeneric.cs @@ -66,14 +66,14 @@ public class Event : IEvent /// 提供事件注册、注销和触发功能。 /// /// 第一个参数类型。 -/// 第二个参数类型。 -public class Event : IEvent +/// 第二个参数类型。 +public class Event : IEvent { /// /// 存储已注册的双参数事件处理委托。 /// 默认为空操作(no-op)委托。 /// - private Action? _mOnEvent = (_, _) => { }; + private Action? _mOnEvent = (_, _) => { }; /// /// 显式实现 IEvent 接口中的 Register 方法。 @@ -85,7 +85,7 @@ public class Event : IEvent { return Register(Action); - void Action(T _, TK __) + void Action(T _, Tk __) { onEvent(); } @@ -96,7 +96,7 @@ public class Event : IEvent /// /// 要注册的事件处理方法。 /// IUnRegister 对象,用于稍后注销该事件监听器。 - public IUnRegister Register(Action onEvent) + public IUnRegister Register(Action onEvent) { _mOnEvent += onEvent; return new DefaultUnRegister(() => { UnRegister(onEvent); }); @@ -106,7 +106,7 @@ public class Event : IEvent /// 取消指定的双参数事件监听器。 /// /// 需要被注销的事件处理方法。 - public void UnRegister(Action onEvent) + public void UnRegister(Action onEvent) { _mOnEvent -= onEvent; } @@ -116,7 +116,7 @@ public class Event : IEvent /// /// 第一个参数。 /// 第二个参数。 - public void Trigger(T t, TK k) + public void Trigger(T t, Tk k) { _mOnEvent?.Invoke(t, k); } diff --git a/GFramework.Core/property/BindableProperty.cs b/GFramework.Core/property/BindableProperty.cs index 9c720f3..624160f 100644 --- a/GFramework.Core/property/BindableProperty.cs +++ b/GFramework.Core/property/BindableProperty.cs @@ -10,7 +10,14 @@ namespace GFramework.Core.property; /// 属性的默认值 public class BindableProperty(T defaultValue = default!) : IBindableProperty { + /// + /// 属性值变化事件回调委托,当属性值发生变化时被调用 + /// private Action? _mOnValueChanged; + + /// + /// 存储属性实际值的受保护字段 + /// protected T MValue = defaultValue; ///