Browse Source

WIP

itemssource-checkpoint2
Steven Kirk 3 years ago
parent
commit
26aa099ad3
  1. 2
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs
  2. 2
      src/Avalonia.Controls/Selection/InternalSelectionModel.cs
  3. 4
      src/Avalonia.Controls/VirtualizingPanel.cs

2
src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

@ -876,7 +876,7 @@ namespace Avalonia.Controls.Primitives
private void OnItemsViewSourceChanged(object? sender, EventArgs e)
{
if (_selection is not null)
if (_selection is not null && _updateState is null)
_selection.Source = ItemsView.Source;
}

2
src/Avalonia.Controls/Selection/InternalSelectionModel.cs

@ -21,8 +21,6 @@ namespace Avalonia.Controls.Selection
SourceReset += OnSourceReset;
}
public bool DataContextIsUpdating { get; set; }
[AllowNull]
public IList WritableSelectedItems
{

4
src/Avalonia.Controls/VirtualizingPanel.cs

@ -193,13 +193,13 @@ namespace Avalonia.Controls
throw new InvalidOperationException("The VirtualizingPanel is already attached to an ItemsControl");
ItemsControl = itemsControl;
ItemsControl.ItemsView.CollectionChanged += OnItemsControlItemsChanged;
ItemsControl.ItemsView.PostCollectionChanged += OnItemsControlItemsChanged;
}
internal void Detach()
{
var itemsControl = EnsureItemsControl();
itemsControl.ItemsView.CollectionChanged -= OnItemsControlItemsChanged;
itemsControl.ItemsView.PostCollectionChanged -= OnItemsControlItemsChanged;
ItemsControl = null;
Children.Clear();
}

Loading…
Cancel
Save