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

Convert Items property to ItemsSource (non-ItemsControl) #10831

Merged
merged 10 commits into from
Apr 16, 2023

Conversation

grokys
Copy link
Member

@grokys grokys commented Mar 29, 2023

What does the pull request do?

Renames the Items property to ItemsSource on controls other than ItemsControl (which was done in #10590). The following controls were converted:

  • DataGrid
  • AutoCompleteBox
  • ItemsRepeater
  • MenuFlyout - this one now has both Items and ItemsSource (from discussion with @maxkatz6 )

For the controls which now have only an ItemsSource property, we could add an Items property for compatibility but I've not done that here. Let me know if that would be a good idea.

Breaking changes

The Items property on DataGrid, AutoCompleteBox and ItemsRepeater has been renamed to ItemsSource.

The Items property on MenuFlyout is now readonly - ItemsSource should be used for setting/binding.

Depends on #10827

@timunie
Copy link
Contributor

timunie commented Mar 29, 2023

For the controls which now have only an ItemsSource property, we could add an Items property for compatibility but I've not done that here. Let me know if that would be a good idea.

I personally think the users would expect that if ListBox has a read-only Items property, DataGrid should work similar. So we have a consistent experience over all controls. But I also understand if we want to avoid this overhead. As you said, it can still be added if frequently complaint about.

@avaloniaui-team
Copy link
Contributor

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

@danwalmsley danwalmsley added this pull request to the merge queue Apr 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 14, 2023
@danwalmsley danwalmsley added this pull request to the merge queue Apr 14, 2023
@danwalmsley danwalmsley removed this pull request from the merge queue due to a manual request Apr 14, 2023
@avaloniaui-team
Copy link
Contributor

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

@avaloniaui-team
Copy link
Contributor

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

@danwalmsley danwalmsley added this pull request to the merge queue Apr 16, 2023
Merged via the queue into master with commit 747c6a6 Apr 16, 2023
@danwalmsley danwalmsley deleted the refactor/other-controls-itemssource branch April 16, 2023 01:16
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