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

Update usages of ItemsControl Items/ItemsSource #10604

Merged
merged 13 commits into from
Mar 16, 2023

Conversation

grokys
Copy link
Member

@grokys grokys commented Mar 8, 2023

What does the pull request do?

Following on from #10590, updates usages of ItemsControl.Items/ItemsSource throughout the repository:

  • Use ItemsSource when appropriate
  • When Items is appropriate, don't use the setter

This is a separate PR because it introduces a lot of noise!

Depends on #10590

grokys added 13 commits March 7, 2023 22:27
`ItemsControl` now works more like WPF, in that there are separate `Items` and `ItemsSource` properties. For backwards compatibility `Items` can still be set, though the setter is deprecated. `Items` needed to be changed from `IEnumerable` to `IList` though.
To allow binding both `ItemsControl.Items` and `ItemsSource` we need to support multiple `InheritDataTypeFromItems` attributes.
It's a view so makes sense to expose the read-only view interface.
One failing.
- Use `ItemsSource` when appropriate
- When `Items` is appropriate, don't use the setter
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0031744-beta. (feed url: https://pkgs.dev.azure.com/AvaloniaUI/AvaloniaUI/_packaging/avalonia-all/nuget/v3/index.json) [PRBUILDID]

Copy link
Member

@danwalmsley danwalmsley left a comment

Choose a reason for hiding this comment

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

LGTM yolo to get it tested

@danwalmsley danwalmsley added this pull request to the merge queue Mar 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 16, 2023
@danwalmsley danwalmsley added this pull request to the merge queue Mar 16, 2023
Merged via the queue into master with commit 70330b5 Mar 16, 2023
@danwalmsley danwalmsley deleted the feature/itemssource-update-usages branch March 16, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants