Skip to content

Remove dead code in AvaloniaObject. - #21452

Merged
MrJul merged 1 commit into
masterfrom
fixes/remove-dead-binding-code
May 28, 2026
Merged

MrJul merged 1 commit into
masterfrom
fixes/remove-dead-binding-code

Conversation

@grokys

@grokys grokys commented May 28, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

Removes some old dead code from AvaloniaObject:

No implementation of BindingBase implements IObservable<T> any more, so the TryBindStyledPropertyUntyped and TryBindDirectPropertyUntyped methods always returned null.

Remove them, and move the IsReadOnly check into a separate method in the spirit of extracting non-generic code from frequently used generic types.

No implementation of `BindingBase` implements `IObservable<T>` any more, so the `TryBindStyledPropertyUntyped` and `TryBindDirectPropertyUntyped` methods always returned null.

Remove them, and move the `IsReadOnly` check into a separate method in the spirit of extracting non-generic code from frequently used generic types.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes obsolete BindingBase handling paths from AvaloniaObject binding overloads and consolidates read-only direct property validation into a shared helper.

Changes:

  • Removed dead untyped binding helper methods for styled and direct properties.
  • Simplified observable binding paths to call _values.AddBinding directly.
  • Extracted repeated direct-property IsReadOnly checks into ThrowIfReadOnly.

@MrJul
MrJul enabled auto-merge May 28, 2026 14:36
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0065870-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
MrJul added this pull request to the merge queue May 28, 2026
Merged via the queue into master with commit ace9039 May 28, 2026
13 checks passed
@MrJul
MrJul deleted the fixes/remove-dead-binding-code branch May 28, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants