Browse Source
Merge pull request #4698 from AvaloniaUI/fixes/small-selection-fixes
Some small selection fixes
pull/4700/head
danwalmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
7 additions and
3 deletions
-
src/Avalonia.Controls/Primitives/SelectingItemsControl.cs
-
src/Avalonia.Controls/Selection/InternalSelectionModel.cs
-
src/Avalonia.Layout/FlowLayoutAlgorithm.cs
|
|
|
@ -491,8 +491,7 @@ namespace Avalonia.Controls.Primitives |
|
|
|
|
|
|
|
if (ItemCount > 0 && |
|
|
|
Match(keymap.SelectAll) && |
|
|
|
(((SelectionMode & SelectionMode.Multiple) != 0) || |
|
|
|
(SelectionMode & SelectionMode.Toggle) != 0)) |
|
|
|
SelectionMode.HasFlag(SelectionMode.Multiple)) |
|
|
|
{ |
|
|
|
Selection.SelectAll(); |
|
|
|
e.Handled = true; |
|
|
|
|
|
|
|
@ -63,6 +63,11 @@ namespace Avalonia.Controls.Selection |
|
|
|
|
|
|
|
private protected override void SetSource(IEnumerable? value) |
|
|
|
{ |
|
|
|
if (Source == value) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
object?[]? oldSelection = null; |
|
|
|
|
|
|
|
if (Source is object && value is object) |
|
|
|
|
|
|
|
@ -211,7 +211,7 @@ namespace Avalonia.Layout |
|
|
|
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
|
|
|
|
// which is not in the realized range. Eg. insert one item at index 0 for a grid layout.
|
|
|
|
|