Browse Source

#2355 Direct access for treeview index values when select all.

pull/2356/head
MonkAlex 7 years ago
parent
commit
33a6ae8215
  1. 5
      src/Avalonia.Controls/Generators/TreeContainerIndex.cs
  2. 3
      src/Avalonia.Controls/TreeView.cs

5
src/Avalonia.Controls/Generators/TreeContainerIndex.cs

@ -36,6 +36,11 @@ namespace Avalonia.Controls.Generators
/// </summary>
public IEnumerable<IControl> Items => _containerToItem.Keys;
/// <summary>
/// Gets the items of currently materialized containers.
/// </summary>
public IEnumerable<object> Objects => _containerToItem.Values;
/// <summary>
/// Adds an entry to the index.
/// </summary>

3
src/Avalonia.Controls/TreeView.cs

@ -411,8 +411,7 @@ namespace Avalonia.Controls
if (this.SelectionMode == SelectionMode.Multiple && Match(keymap.SelectAll))
{
var allVisibleItems = ItemContainerGenerator.Index.Items.Select(ItemContainerGenerator.Index.ItemFromContainer);
SelectingItemsControl.SynchronizeItems(SelectedItems, allVisibleItems);
SelectingItemsControl.SynchronizeItems(SelectedItems, ItemContainerGenerator.Index.Objects);
e.Handled = true;
}
}

Loading…
Cancel
Save