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...
pull/691/head
Steven Kirk 10 years ago
parent
commit
922b0c5cd7
  1. 11
      src/Avalonia.Controls/ItemsControl.cs

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>

Loading…
Cancel
Save