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

Fix TreeViewItem Expand/Collapse event source #17558

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

rabbitism
Copy link
Contributor

What does the pull request do?

What is the current behavior?

After #16984, TreeView can now subscribe to children Expand/Collapse event. But there are two issues for the implementation.

  1. The event source is coerced to TreeView
  2. The TreeViewItem itself doesn't raise any event to subscribe.

What is the updated/expected behavior with this PR?

By subscribing to the TreeViewItem.Expand or TreeViewItem.Collapse event, developer should know which exactly TreeViewItem is raising the event.

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

Simply raise the event from TreeViewItem. since it's Bubble|Tunnel, TreeView can still catch it.

Two fail unit tests have been added to address the issue.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link

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

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@MrJul MrJul merged commit 6728f06 into AvaloniaUI:master Nov 19, 2024
8 of 10 checks passed
@MrJul MrJul added bug backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 19, 2024
maxkatz6 pushed a commit that referenced this pull request Nov 26, 2024
* test: add two fail tests.

* fix: fix Expand/Collapse event source.
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 26, 2024
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.

4 participants