Skip to content

Commit

Permalink
fix: Apply coercion before value is set
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Aug 26, 2021
1 parent 58b37be commit 7be2c37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Uno.UI/UI/Xaml/DependencyObjectStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 7be2c37

Please sign in to comment.