Browse Source

Merge branch 'master' into fixes/avalonialist-copyto

pull/4695/head
danwalmsley 6 years ago
committed by GitHub
parent
commit
6a13142f71
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs
  2. 5
      src/Avalonia.Controls/Selection/InternalSelectionModel.cs
  3. 9
      src/Avalonia.Input/KeyboardNavigation.cs
  4. 2
      src/Avalonia.Layout/FlowLayoutAlgorithm.cs

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

@ -491,8 +491,7 @@ namespace Avalonia.Controls.Primitives
if (ItemCount > 0 && if (ItemCount > 0 &&
Match(keymap.SelectAll) && Match(keymap.SelectAll) &&
(((SelectionMode & SelectionMode.Multiple) != 0) || SelectionMode.HasFlag(SelectionMode.Multiple))
(SelectionMode & SelectionMode.Toggle) != 0))
{ {
Selection.SelectAll(); Selection.SelectAll();
e.Handled = true; e.Handled = true;

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

@ -63,6 +63,11 @@ namespace Avalonia.Controls.Selection
private protected override void SetSource(IEnumerable? value) private protected override void SetSource(IEnumerable? value)
{ {
if (Source == value)
{
return;
}
object?[]? oldSelection = null; object?[]? oldSelection = null;
if (Source is object && value is object) if (Source is object && value is object)

9
src/Avalonia.Input/KeyboardNavigation.cs

@ -25,12 +25,11 @@ namespace Avalonia.Input
/// attached property set to <see cref="KeyboardNavigationMode.Once"/>, this property /// attached property set to <see cref="KeyboardNavigationMode.Once"/>, this property
/// defines to which child the focus should move. /// defines to which child the focus should move.
/// </remarks> /// </remarks>
public static readonly AttachedProperty<IInputElement> TabOnceActiveElementProperty = public static readonly AttachedProperty<IInputElement?> TabOnceActiveElementProperty =
AvaloniaProperty.RegisterAttached<InputElement, IInputElement>( AvaloniaProperty.RegisterAttached<InputElement, IInputElement?>(
"TabOnceActiveElement", "TabOnceActiveElement",
typeof(KeyboardNavigation)); typeof(KeyboardNavigation));
/// <summary> /// <summary>
/// Defines the IsTabStop attached property. /// Defines the IsTabStop attached property.
/// </summary> /// </summary>
@ -68,7 +67,7 @@ namespace Avalonia.Input
/// </summary> /// </summary>
/// <param name="element">The container.</param> /// <param name="element">The container.</param>
/// <returns>The active element for the container.</returns> /// <returns>The active element for the container.</returns>
public static IInputElement GetTabOnceActiveElement(InputElement element) public static IInputElement? GetTabOnceActiveElement(InputElement element)
{ {
return element.GetValue(TabOnceActiveElementProperty); return element.GetValue(TabOnceActiveElementProperty);
} }
@ -78,7 +77,7 @@ namespace Avalonia.Input
/// </summary> /// </summary>
/// <param name="element">The container.</param> /// <param name="element">The container.</param>
/// <param name="value">The active element for the container.</param> /// <param name="value">The active element for the container.</param>
public static void SetTabOnceActiveElement(InputElement element, IInputElement value) public static void SetTabOnceActiveElement(InputElement element, IInputElement? value)
{ {
element.SetValue(TabOnceActiveElementProperty, value); element.SetValue(TabOnceActiveElementProperty, value);
} }

2
src/Avalonia.Layout/FlowLayoutAlgorithm.cs

@ -211,7 +211,7 @@ namespace Avalonia.Layout
anchorPosition = new Point(anchorBounds.X, anchorBounds.Y); anchorPosition = new Point(anchorBounds.X, anchorBounds.Y);
} }
} }
else else if (anchorIndex >= 0)
{ {
// It is possible to end up in a situation during a collection change where GetAnchorForTargetElement returns an index // It is possible to end up in a situation during a collection change where GetAnchorForTargetElement returns an index
// which is not in the realized range. Eg. insert one item at index 0 for a grid layout. // which is not in the realized range. Eg. insert one item at index 0 for a grid layout.

Loading…
Cancel
Save