Browse Source

Don't clear ItemContainerGenerator on template change.

Can't remember why this was there but it was wrong anway - it wasn't
actually removing the items from the presenter panel. Doesn't seem to
break any unit tests so hope for the best...
Steven Kirk 9 năm trước cách đây
mục cha
commit
922b0c5cd7
1 tập tin đã thay đổi với 0 bổ sung11 xóa
  1. 0 11
      src/Avalonia.Controls/ItemsControl.cs

+ 0 - 11
src/Avalonia.Controls/ItemsControl.cs

@@ -287,17 +287,6 @@ namespace Avalonia.Controls
             LogicalChildren.RemoveAll(toRemove);
         }
 
-        /// <inheritdoc/>
-        protected override void OnTemplateChanged(AvaloniaPropertyChangedEventArgs e)
-        {
-            base.OnTemplateChanged(e);
-
-            if (e.NewValue == null)
-            {
-                ItemContainerGenerator?.Clear();
-            }
-        }
-
         /// <summary>
         /// Caled when the <see cref="Items"/> property changes.
         /// </summary>