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

LixtBox SelectedItem does not work correctly in combination with CollectionViewSource as ItemsSource #636

Open
spacilv opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@spacilv
Copy link

spacilv commented Jan 10, 2025

Hi
I encountered and issue with the ListBox control and SelectedItem (bind to ViewModel) which is reset to null when the CollectionViewSource is used as an ItemsSource and when moving between pages using Frame functionality. Please see the attached gif below and minimal sample.
When the CollectionViewSource is used for the outer ListBox then everything is working ok, only inner ListBox has a problem to hold the SelectedItem because CollectionViewSource.Source is set to null for some reason when moving back and forth between pages.

OS: Windows 11, macOS 15.2
Avalonia UI: 11.0.11
FluentAvalonia: 2.0.5

fa_issue_selecteditem
Minimal Sample: selecteditemtest.zip

@spacilv spacilv added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant