Is your feature request related to a problem? Please describe.
Currently, as soon as SelectedItemsControl doesn't contain its SelectedItem/SelectedIndex/SelectedValue anymore, the selection is reset.
While we have various workarounds present to prevent selection from being changed too aggressively at init time (such as #18634), scenarios exist where it makes sense to have the selection uncorrelated from the items, notably for ComboBox.
For example, a common scenario is to have the ItemsSource loaded later. It could be on demand when the ComboBox opens, or loaded in chunks if the source is too large.
Describe the solution you'd like
A new property should be added to keep the existing selection, until the user explicitly interacts with it through the SelectingItemsControl.
Proposed names:
KeepsSelection
AllowSelectionOutsideItems
AutoResetSelection (reverse behavior, true by default)
Describe alternatives you've considered
No response
Additional context
#18147, #18323 and probably others I can't find right now.
Is your feature request related to a problem? Please describe.
Currently, as soon as
SelectedItemsControldoesn't contain itsSelectedItem/SelectedIndex/SelectedValueanymore, the selection is reset.While we have various workarounds present to prevent selection from being changed too aggressively at init time (such as #18634), scenarios exist where it makes sense to have the selection uncorrelated from the items, notably for
ComboBox.For example, a common scenario is to have the
ItemsSourceloaded later. It could be on demand when theComboBoxopens, or loaded in chunks if the source is too large.Describe the solution you'd like
A new property should be added to keep the existing selection, until the user explicitly interacts with it through the
SelectingItemsControl.Proposed names:
KeepsSelectionAllowSelectionOutsideItemsAutoResetSelection(reverse behavior,trueby default)Describe alternatives you've considered
No response
Additional context
#18147, #18323 and probably others I can't find right now.