Browse Source

Make items be materialized only once.

When virtualization was turned off in an `ItemsControl`, items were virtualized twice. on control creation. Fix that.
pull/4282/head
Steven Kirk 6 years ago
parent
commit
68792668ad
  1. 5
      src/Avalonia.Controls/Presenters/CarouselPresenter.cs
  2. 2
      src/Avalonia.Controls/Presenters/ItemsPresenterBase.cs

5
src/Avalonia.Controls/Presenters/CarouselPresenter.cs

@ -155,6 +155,11 @@ namespace Avalonia.Controls.Presenters
}
}
protected override void PanelCreated(IPanel panel)
{
ItemsChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
/// <summary>
/// Moves to the selected page, animating if a <see cref="PageTransition"/> is set.
/// </summary>

2
src/Avalonia.Controls/Presenters/ItemsPresenterBase.cs

@ -229,8 +229,6 @@ namespace Avalonia.Controls.Presenters
}
PanelCreated(Panel);
ItemsChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
/// <summary>

Loading…
Cancel
Save