Hello George,
Please find attached a very simple test case. It starts with an empty RadListBox, and 3 buttons.
- The first button fills the RadListBox with 100 items
- The second button sets the ItemsSource to null
- The third button removes and re-adds the RadListBox to the visual tree
(1) Launch the example in the debugger and put a breakpoint in every method of MainPage.xaml.cs.
(2) Click FillRadListBox.
(3) Select "Item 4"
(4) Click Empty RadListBox --> once the ItemsSource is set to null, you can see that RadListBox.cachedSelectedItem is "Item 4" and cachedSelectedItems has one item, "Item 4"
(5) Now click Unload RadListBox --> when you break into _onUnloaded, you can see, again, that cachedSelectedItem and cachedSelectedItems have the same value
Which means that emptying the RadListBox or unloading it does not reset cachedSelectedItem or cachedSelectedItems.
Can you confirm this? Do you have any suggestion?
Thank you!
Carlos.
P.S. I could not attach any zip file, so I unfortunately have to paste the code below...