FluentAvalonia icon indicating copy to clipboard operation
FluentAvalonia copied to clipboard

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

Open spacilv opened this issue 11 months ago • 0 comments

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 avatar Jan 10 '25 13:01 spacilv