Force value changed and invalidate implementation in property adapter.

This commit is contained in:
2023-12-25 14:21:37 +08:00
parent c66b7da63b
commit a532a9f4c1
2 changed files with 8 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ namespace Cryville.Crtr.Config {
object GetValue();
void SetValue(object value);
event Action ValueChanged;
void Invalidate();
object MapValue(object value);
bool SetMapped { get; }
object MapValueInverse(object value);
@@ -38,7 +39,10 @@ namespace Cryville.Crtr.Config {
public object GetValue() { return _prop.GetValue(_target, null); }
public void SetValue(object value) { _prop.SetValue(_target, value, null); }
public event Action ValueChanged { add { } remove { } }
public event Action ValueChanged;
public void Invalidate() {
ValueChanged?.Invoke();
}
readonly double _precision;
readonly double _step;