2017-04-18 07:52:04 +08:00
|
|
|
## Items.Clear does not remove duplicates from SelectedItems
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Scope
|
|
|
|
Minor
|
|
|
|
|
|
|
|
### Version Introduced
|
|
|
|
4.5
|
|
|
|
|
|
|
|
### Version Reverted
|
|
|
|
4.6.2
|
|
|
|
|
|
|
|
### Source Analyzer Status
|
|
|
|
NotPlanned
|
|
|
|
|
|
|
|
### Change Description
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
Suppose a Selector (with multiple selection enabled) has duplicates in its
|
|
|
|
<xref:System.Windows.Controls.Primitives.MultiSelector.SelectedItems?displayProperty=name>
|
2017-04-06 04:52:19 +08:00
|
|
|
collection - the same item appears more than once. Removing those items from the
|
2017-04-21 02:19:05 +08:00
|
|
|
data source (e.g. by calling Items.Clear) fails to remove them from
|
|
|
|
<xref:System.Windows.Controls.Primitives.MultiSelector.SelectedItems?displayProperty=name>;
|
|
|
|
only the first instance is removed. Furthermore, subsequent use of
|
|
|
|
<xref:System.Windows.Controls.Primitives.MultiSelector.SelectedItems?displayProperty=name>
|
|
|
|
(e.g. SelectedItems.Clear()) can encounter problems such as
|
|
|
|
<xref:System.ArgumentException?displayProperty=name>, because
|
|
|
|
<xref:System.Windows.Controls.Primitives.MultiSelector.SelectedItems?displayProperty=name>
|
|
|
|
contains items that are no longer in the data source.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
- [ ] Quirked
|
|
|
|
- [ ] Build-time break
|
|
|
|
|
|
|
|
### Recommended Action
|
2018-03-01 08:06:28 +08:00
|
|
|
Upgrade if possible to .NET Framework 4.6.2.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Affected APIs
|
|
|
|
* `P:System.Windows.Controls.Primitives.MultiSelector.SelectedItems`
|
|
|
|
|
|
|
|
### Category
|
|
|
|
Windows Presentation Foundation (WPF)
|
|
|
|
|
|
|
|
<!--
|
|
|
|
### Original Bug
|
|
|
|
154627
|
|
|
|
-->
|
|
|
|
|
2017-04-18 07:52:04 +08:00
|
|
|
<!-- breaking change id: 154 -->
|