Browse Source

fix selected item notify after been changed issue #4875

pull/4876/head
Andrey Kunchev 6 years ago
parent
commit
82d17aa8ae
  1. 3
      src/Avalonia.Controls/Selection/SelectionModel.cs

3
src/Avalonia.Controls/Selection/SelectionModel.cs

@ -442,7 +442,8 @@ namespace Avalonia.Controls.Selection
RaisePropertyChanged(nameof(SelectedIndex)); RaisePropertyChanged(nameof(SelectedIndex));
} }
if (e.Action == NotifyCollectionChangedAction.Remove && e.OldStartingIndex <= oldSelectedIndex) if ((e.Action == NotifyCollectionChangedAction.Remove && e.OldStartingIndex <= oldSelectedIndex) ||
e.Action == NotifyCollectionChangedAction.Reset)
{ {
RaisePropertyChanged(nameof(SelectedItem)); RaisePropertyChanged(nameof(SelectedItem));
} }

Loading…
Cancel
Save