From 922b0c5cd708886c308891b7ca90489d25de4ead Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 19 Aug 2016 00:40:41 +0200 Subject: [PATCH] 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... --- src/Avalonia.Controls/ItemsControl.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Avalonia.Controls/ItemsControl.cs b/src/Avalonia.Controls/ItemsControl.cs index 8e8603ca24..7d9c9fcc40 100644 --- a/src/Avalonia.Controls/ItemsControl.cs +++ b/src/Avalonia.Controls/ItemsControl.cs @@ -287,17 +287,6 @@ namespace Avalonia.Controls LogicalChildren.RemoveAll(toRemove); } - /// - protected override void OnTemplateChanged(AvaloniaPropertyChangedEventArgs e) - { - base.OnTemplateChanged(e); - - if (e.NewValue == null) - { - ItemContainerGenerator?.Clear(); - } - } - /// /// Caled when the property changes. ///