Browse Source

Short-circuit setting source to current value.

Steven Kirk 5 years ago
parent
commit
89684e5b94
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/Avalonia.Controls/Selection/InternalSelectionModel.cs

+ 5 - 0
src/Avalonia.Controls/Selection/InternalSelectionModel.cs

@@ -63,6 +63,11 @@ namespace Avalonia.Controls.Selection
 
         private protected override void SetSource(IEnumerable? value)
         {
+            if (Source == value)
+            {
+                return;
+            }
+
             object?[]? oldSelection = null;
 
             if (Source is object && value is object)