Browse Source

#2355 Ctrl+A hotkey for SelectingItemsControl

pull/2356/head
MonkAlex 8 years ago
parent
commit
e3d7d47753
  1. 17
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

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

@ -459,6 +459,23 @@ namespace Avalonia.Controls.Primitives
}
}
/// <summary>
/// Handles 'select all' (Ctrl+A) in <see cref="SelectingItemsControl"/>.
/// </summary>
/// <param name="e">The key events.</param>
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
if (!e.Handled)
{
if (this.SelectionMode == SelectionMode.Multiple && e.Key == Key.A && e.Modifiers == InputModifiers.Control)
{
SynchronizeItems(SelectedItems, Items?.Cast<object>());
}
}
}
/// <summary>
/// Moves the selection in the specified direction relative to the current selection.
/// </summary>

Loading…
Cancel
Save