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 changing ItemsControl.ItemContainerTheme #12630

Merged
merged 6 commits into from
Aug 24, 2023

Conversation

grokys
Copy link
Member

@grokys grokys commented Aug 22, 2023

What does the pull request do?

As described in #12620, changing an ItemsControl's ItemContainerTheme didn't result in the change being reflected visually in some cases. The solution provided in #12620 by @timunie was almost correct but didn't correctly handle the ItemContainerTheme being set to null.

Fixed these issues and added unit tests.

In doing so, I noticed that the check for GetStyleKey(container) == itemContainerTheme.TargetType was incorrect as it should be possible to specify the TargetType using a base class. Also added a test for this and fixed it.

Fixed issues

Fixes #12620

One failing.
Previously only handled the case where the `ItemContainerTheme` was changing from null -> non-null.

Fixes #12620
@grokys grokys marked this pull request as draft August 22, 2023 12:19
@avaloniaui-team
Copy link
Contributor

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

@avaloniaui-team
Copy link
Contributor

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

@billhenn
Copy link
Contributor

Latest PR code resolves our issue.

@grokys grokys marked this pull request as ready for review August 22, 2023 14:11
@timunie timunie added this pull request to the merge queue Aug 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 24, 2023
@Gillibald Gillibald added this pull request to the merge queue Aug 24, 2023
Merged via the queue into master with commit 1b6a52d Aug 24, 2023
7 checks passed
@Gillibald Gillibald deleted the fixes/12620-itemcontainertheme-changes branch August 24, 2023 12:32
@grokys grokys added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Sep 29, 2023
grokys pushed a commit that referenced this pull request Oct 2, 2023
…eme-changes

Fix changing `ItemsControl.ItemContainerTheme`
@grokys grokys added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Oct 14, 2023
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.

ItemsControl.ItemContainerTheme doesn't have new value applied after change
5 participants