FluentAvalonia
FluentAvalonia copied to clipboard
LixtBox SelectedItem does not work correctly in combination with CollectionViewSource as ItemsSource
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
Minimal Sample: selecteditemtest.zip