Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bit of code refactor #15366

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Avalonia.Base/AvaloniaPropertyRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public DirectPropertyBase<T> GetRegisteredDirect<T>(
AvaloniaObject o,
DirectPropertyBase<T> property)
{
if (property.Owner == o.GetType())
if (property.OwnerType == o.GetType())
{
return property;
}
Expand Down
2 changes: 0 additions & 2 deletions src/Avalonia.Base/DirectProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ internal DirectProperty(
{
Getter = getter ?? throw new ArgumentNullException(nameof(getter));
Setter = setter;
IsDirect = true;
IsReadOnly = setter is null;
}

Expand All @@ -52,7 +51,6 @@ private DirectProperty(
{
Getter = getter ?? throw new ArgumentNullException(nameof(getter));
Setter = setter;
IsDirect = true;
IsReadOnly = setter is null;
}

Expand Down
9 changes: 2 additions & 7 deletions src/Avalonia.Base/DirectPropertyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private protected DirectPropertyBase(
AvaloniaPropertyMetadata metadata)
: base(name, ownerType, ownerType, metadata)
{
Owner = ownerType;
IsDirect = true;
}

/// <summary>
Expand All @@ -42,14 +42,9 @@ private protected DirectPropertyBase(
AvaloniaPropertyMetadata metadata)
: base(source, ownerType, metadata)
{
Owner = ownerType;
IsDirect = true;
}

/// <summary>
/// Gets the type that registered the property.
/// </summary>
public Type Owner { get; }

/// <summary>
/// Gets the value of the property on the instance.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Base/IDirectPropertyAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal interface IDirectPropertyAccessor
/// <summary>
/// Gets the class that registered the property.
/// </summary>
Type Owner { get; }
Type OwnerType { get; }

/// <summary>
/// Gets the value of the property on the instance.
Expand Down
Loading