Skip to content

Comments

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

Merged
danwalmsley merged 10 commits intomasterfrom
refactor/other-controls-itemssource
Apr 16, 2023
Merged

Convert Items property to ItemsSource (non-ItemsControl)#10831
danwalmsley merged 10 commits intomasterfrom
refactor/other-controls-itemssource

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
Collaborator

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]

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks 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]

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