Skip to content

Support {Binding ^} pattern for IObservable DataContext - #21812

Merged
MrJul merged 2 commits into
AvaloniaUI:mainfrom
irihitech:fix/stream-binding
Jul 22, 2026
Merged

Support {Binding ^} pattern for IObservable DataContext#21812
MrJul merged 2 commits into
AvaloniaUI:mainfrom
irihitech:fix/stream-binding

Conversation

@rabbitism

Copy link
Copy Markdown
Contributor

What does the pull request do?

Previously {Binding ^} was not parsed because ParseStart did not recognize the ^ stream operator. Also, {Binding .^} failed because ParseDot returned State.End immediately, preventing subsequent operators.

Changes:

  • ParseStart: recognize ^, emit EmptyExpressionNode + StreamNode
  • ParseDot: return State.AfterMember instead of State.End, so .^ works
  • Add grammar tests for ^ and .^ patterns

I have verified and it works in BindingDemo project.

What is the current behavior?

Expression not supported

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Previously {Binding ^} was not parsed because ParseStart did not
recognize the ^ stream operator. Also, {Binding .^} failed because
ParseDot returned State.End immediately, preventing subsequent
operators.

Changes:
- ParseStart: recognize ^, emit EmptyExpressionNode + StreamNode
- ParseDot: return State.AfterMember instead of State.End, so .^ works
- Add grammar tests for ^ and .^ patterns
@MrJul MrJul added area-xaml bug area-bindings backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Jul 21, 2026
@avaloniaui-bot

Copy link
Copy Markdown

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

@avaloniaui-bot

Copy link
Copy Markdown

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

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@MrJul
MrJul added this pull request to the merge queue Jul 22, 2026
Merged via the queue into AvaloniaUI:main with commit 82dc3b5 Jul 22, 2026
9 checks passed
MrJul pushed a commit that referenced this pull request Jul 29, 2026
Previously {Binding ^} was not parsed because ParseStart did not
recognize the ^ stream operator. Also, {Binding .^} failed because
ParseDot returned State.End immediately, preventing subsequent
operators.

Changes:
- ParseStart: recognize ^, emit EmptyExpressionNode + StreamNode
- ParseDot: return State.AfterMember instead of State.End, so .^ works
- Add grammar tests for ^ and .^ patterns
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Jul 29, 2026
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.

3 participants