diff --git a/src/Avalonia.Base/AvaloniaPropertyRegistry.cs b/src/Avalonia.Base/AvaloniaPropertyRegistry.cs index a772f32bf0a..27852653f90 100644 --- a/src/Avalonia.Base/AvaloniaPropertyRegistry.cs +++ b/src/Avalonia.Base/AvaloniaPropertyRegistry.cs @@ -331,7 +331,7 @@ public DirectPropertyBase GetRegisteredDirect( AvaloniaObject o, DirectPropertyBase property) { - if (property.Owner == o.GetType()) + if (property.OwnerType == o.GetType()) { return property; } diff --git a/src/Avalonia.Base/DirectProperty.cs b/src/Avalonia.Base/DirectProperty.cs index ef1b67615f5..3bf8c36d40c 100644 --- a/src/Avalonia.Base/DirectProperty.cs +++ b/src/Avalonia.Base/DirectProperty.cs @@ -32,7 +32,6 @@ internal DirectProperty( { Getter = getter ?? throw new ArgumentNullException(nameof(getter)); Setter = setter; - IsDirect = true; IsReadOnly = setter is null; } @@ -52,7 +51,6 @@ private DirectProperty( { Getter = getter ?? throw new ArgumentNullException(nameof(getter)); Setter = setter; - IsDirect = true; IsReadOnly = setter is null; } diff --git a/src/Avalonia.Base/DirectPropertyBase.cs b/src/Avalonia.Base/DirectPropertyBase.cs index 64eb4d2615f..580bd4403be 100644 --- a/src/Avalonia.Base/DirectPropertyBase.cs +++ b/src/Avalonia.Base/DirectPropertyBase.cs @@ -27,7 +27,7 @@ private protected DirectPropertyBase( AvaloniaPropertyMetadata metadata) : base(name, ownerType, ownerType, metadata) { - Owner = ownerType; + IsDirect = true; } /// @@ -42,14 +42,9 @@ private protected DirectPropertyBase( AvaloniaPropertyMetadata metadata) : base(source, ownerType, metadata) { - Owner = ownerType; + IsDirect = true; } - /// - /// Gets the type that registered the property. - /// - public Type Owner { get; } - /// /// Gets the value of the property on the instance. /// diff --git a/src/Avalonia.Base/IDirectPropertyAccessor.cs b/src/Avalonia.Base/IDirectPropertyAccessor.cs index f92ca1fbf8f..9df25af0643 100644 --- a/src/Avalonia.Base/IDirectPropertyAccessor.cs +++ b/src/Avalonia.Base/IDirectPropertyAccessor.cs @@ -17,7 +17,7 @@ internal interface IDirectPropertyAccessor /// /// Gets the class that registered the property. /// - Type Owner { get; } + Type OwnerType { get; } /// /// Gets the value of the property on the instance.