diff --git a/Toolkit.Foundation/ObservableCollection.cs b/Toolkit.Foundation/ObservableCollection.cs index aabf724..493048d 100644 --- a/Toolkit.Foundation/ObservableCollection.cs +++ b/Toolkit.Foundation/ObservableCollection.cs @@ -557,6 +557,19 @@ public partial class ObservableCollection : CollectionChanged?.Invoke(this, args); } + partial void OnSelectedItemChanged(TItem? oldValue, TItem? newValue) + { + if (oldValue is ISelectable oldSelection) + { + oldSelection.Selected = false; + } + + if (newValue is ISelectable newSelection) + { + newSelection.Selected = true; + } + } + private void UpdateSelection(TItem item) { if (item is ISelectable newSelection)