diff --git a/src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs b/src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs index 0788b39459..330034f51d 100644 --- a/src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs +++ b/src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs @@ -31,7 +31,7 @@ namespace Avalonia.PropertyStore var value = inherited is null ? _metadata.DefaultValue : inherited.Value; - if (property.HasCoercion && _metadata.CoerceValue is { } coerce) + if (_metadata.CoerceValue is { } coerce) { _uncommon = new() { diff --git a/src/Avalonia.Base/StyledProperty.cs b/src/Avalonia.Base/StyledProperty.cs index dfe5a44f1b..e1b88cde49 100644 --- a/src/Avalonia.Base/StyledProperty.cs +++ b/src/Avalonia.Base/StyledProperty.cs @@ -34,7 +34,6 @@ namespace Avalonia { Inherits = inherits; ValidateValue = validate; - HasCoercion |= metadata.CoerceValue != null; if (validate?.Invoke(metadata.DefaultValue) == false) { @@ -48,12 +47,6 @@ namespace Avalonia /// public Func? ValidateValue { get; } - /// - /// Gets a value indicating whether this property has any value coercion callbacks defined - /// in its metadata. - /// - internal bool HasCoercion { get; private set; } - /// /// Registers the property on another type. /// @@ -130,10 +123,7 @@ namespace Avalonia /// /// The type. /// The metadata. - public void OverrideMetadata(StyledPropertyMetadata metadata) where T : AvaloniaObject - { - base.OverrideMetadata(typeof(T), metadata); - } + public void OverrideMetadata(StyledPropertyMetadata metadata) where T : AvaloniaObject => OverrideMetadata(typeof(T), metadata); /// /// Overrides the metadata for the property on the specified type. @@ -151,8 +141,6 @@ namespace Avalonia } } - HasCoercion |= metadata.CoerceValue != null; - base.OverrideMetadata(type, metadata); }