I have a Listbox
that bind to an ObservableCollection
. In my app, I need to clear this collection in OnNavigatedFrom
and read it in OnNavigatedTo
to reduced memory.
However, I see that when using StackPanel
as ItemsPanelTemplate
, Listbox
can remember its last view (its seletected item), while VirtualizingStackPanel
does not.
So how can I disable this behavior when using StackPanel
?