Browse Source

Fix pre selection

pull/3186/head
Benedikt Schroeder 7 years ago
parent
commit
876ecab433
  1. 10
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

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

@ -367,17 +367,17 @@ namespace Avalonia.Controls.Primitives
{
if ((container.ContainerControl as ISelectable)?.IsSelected == true)
{
if (SelectedIndex == -1)
{
SelectedIndex = container.Index;
}
else
if (SelectionMode.HasFlag(SelectionMode.Multiple))
{
if (_selection.Add(container.Index))
{
resetSelectedItems = true;
}
}
else
{
SelectedIndex = container.Index;
}
MarkContainerSelected(container.ContainerControl, true);
}

Loading…
Cancel
Save