using GFramework.Core.Abstractions.Events;
namespace GFramework.Core.Abstractions.Property;
///
/// 只读可绑定属性接口,提供属性值的读取和变更监听功能
///
/// 属性值的类型
public interface IReadonlyBindableProperty : IEvent
{
///
/// 获取属性的当前值
///
T Value { get; }
///
/// 注册属性值变更回调,并立即执行一次初始值的回调
///
/// 属性值变更时执行的回调函数,参数为新的属性值
/// 用于取消注册的句柄对象
IUnRegister RegisterWithInitValue(Action action);
///
/// 取消注册属性值变更回调
///
/// 要取消注册的回调函数
void UnRegister(Action onValueChanged);
///
/// 注册属性值变更回调
///
/// 属性值变更时执行的回调函数,参数为新的属性值
/// 用于取消注册的句柄对象
IUnRegister Register(Action onValueChanged);
}