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

Make SelectionModel.SelectedItems and SelectedIndexes implement INCC. #15498

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

grokys
Copy link
Member

@grokys grokys commented Apr 24, 2024

What does the pull request do?

Make SelectionModel.SelectedItems and SelectionModel.SelectedIndexes implement INotifyCollectionChanged so that they can be bound to.

As well as implementing INotifyCollectionChanged on the collections, we also had to implement IList (see #8764) so refactored this out into a base class.

For the sake of simplicity, these collections only raise Reset for any change: this is may need to be changed later but I'd rather follow the KISS principle for the moment until something more complex is proven necessary.

Fixed issues

Fixes #15497

Make `SelectionModel.SelectedItems` and `SelectionModel.SelectedIndexes` implement `INotifyCollectionChanged` so that they can be bound to.

As well as implementing `INotifyCollectionChanged` on the collections, we also had to implement `IList` (see #8764) so refactored this out into a base class.

For the sake of simplicity, these collections only raise `Reset` for any change: this is may need to be changed later but I'd rather follow the KISS principle for the moment until something more complex is proven necessary.

Fixes #15497
@grokys grokys added enhancement customer-priority Issue reported by a customer with a support agreement. labels Apr 24, 2024
@grokys grokys changed the title SelectedItems and SelectedIndexes implement INCC. Make SelectionModel.SelectedItems and SelectedIndexes implement INCC. Apr 24, 2024
@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label Apr 24, 2024
@maxkatz6 maxkatz6 merged commit 9287ab5 into master Apr 24, 2024
11 checks passed
@maxkatz6 maxkatz6 deleted the fixes/15497-selectionmodel-collectionchanged branch April 24, 2024 23:40
maxkatz6 pushed a commit that referenced this pull request Apr 25, 2024
Make `SelectionModel.SelectedItems` and `SelectionModel.SelectedIndexes` implement `INotifyCollectionChanged` so that they can be bound to.

As well as implementing `INotifyCollectionChanged` on the collections, we also had to implement `IList` (see #8764) so refactored this out into a base class.

For the sake of simplicity, these collections only raise `Reset` for any change: this is may need to be changed later but I'd rather follow the KISS principle for the moment until something more complex is proven necessary.

Fixes #15497
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported-11.1.x customer-priority Issue reported by a customer with a support agreement. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to bind to SelectionModel.SelectedItems or SelectedIndexes
3 participants