|
|
@ -57,7 +57,8 @@ namespace Avalonia |
|
|
{ |
|
|
{ |
|
|
if (priority == (int)BindingPriority.LocalValue) |
|
|
if (priority == (int)BindingPriority.LocalValue) |
|
|
{ |
|
|
{ |
|
|
_propertyValues.SetValue(property, Validate(property, value)); |
|
|
Validate(property, ref value); |
|
|
|
|
|
_propertyValues.SetValue(property, value); |
|
|
Changed(property, priority, v, value); |
|
|
Changed(property, priority, v, value); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
@ -78,7 +79,8 @@ namespace Avalonia |
|
|
|
|
|
|
|
|
if (priority == (int)BindingPriority.LocalValue) |
|
|
if (priority == (int)BindingPriority.LocalValue) |
|
|
{ |
|
|
{ |
|
|
_propertyValues.AddValue(property, Validate(property, value)); |
|
|
Validate(property, ref value); |
|
|
|
|
|
_propertyValues.AddValue(property, value); |
|
|
Changed(property, priority, AvaloniaProperty.UnsetValue, value); |
|
|
Changed(property, priority, AvaloniaProperty.UnsetValue, value); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
@ -166,16 +168,14 @@ namespace Avalonia |
|
|
validate2); |
|
|
validate2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private object Validate(AvaloniaProperty property, object value) |
|
|
private void Validate(AvaloniaProperty property, ref object value) |
|
|
{ |
|
|
{ |
|
|
var validate = ((IStyledPropertyAccessor)property).GetValidationFunc(_owner.GetType()); |
|
|
var validate = ((IStyledPropertyAccessor)property).GetValidationFunc(_owner.GetType()); |
|
|
|
|
|
|
|
|
if (validate != null && value != AvaloniaProperty.UnsetValue) |
|
|
if (validate != null && value != AvaloniaProperty.UnsetValue) |
|
|
{ |
|
|
{ |
|
|
return validate(_owner, value); |
|
|
value = validate(_owner, value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return value; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private DeferredSetter<T> GetDeferredSetter<T>(AvaloniaProperty property) |
|
|
private DeferredSetter<T> GetDeferredSetter<T>(AvaloniaProperty property) |
|
|
|