Browse Source

Ensure to update scroll info when items changed.

pull/554/head
Steven Kirk 10 years ago
parent
commit
cce2ab603f
  1. 9
      src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs

9
src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs

@ -2,7 +2,10 @@
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Utils;
namespace Avalonia.Controls.Presenters
@ -122,6 +125,12 @@ namespace Avalonia.Controls.Presenters
CreateRemoveContainers();
}
public override void ItemsChanged(IEnumerable items, NotifyCollectionChangedEventArgs e)
{
base.ItemsChanged(items, e);
((IScrollable)Owner).InvalidateScroll();
}
private void CreateRemoveContainers()
{
var generator = Owner.ItemContainerGenerator;

Loading…
Cancel
Save