diff --git a/src/Uno.UI/UI/Xaml/DependencyObjectStore.cs b/src/Uno.UI/UI/Xaml/DependencyObjectStore.cs index 12849d119373..4cc086db9149 100644 --- a/src/Uno.UI/UI/Xaml/DependencyObjectStore.cs +++ b/src/Uno.UI/UI/Xaml/DependencyObjectStore.cs @@ -461,6 +461,8 @@ private void InnerSetValue(DependencyProperty property, object? value, Dependenc var previousValue = GetValue(propertyDetails); var previousPrecedence = GetCurrentHighestValuePrecedence(propertyDetails); + ApplyCoercion(actualInstanceAlias, propertyDetails, previousValue, value); + // Set even if they are different to make sure the value is now set on the right precedence SetValueInternal(value, precedence, propertyDetails); @@ -470,8 +472,6 @@ private void InnerSetValue(DependencyProperty property, object? value, Dependenc _resourceBindings?.ClearBinding(property, precedence); } - ApplyCoercion(actualInstanceAlias, propertyDetails, previousValue, value); - // Value may or may not have changed based on the precedence var newValue = GetValue(propertyDetails); var newPrecedence = GetCurrentHighestValuePrecedence(propertyDetails);