|
|
|
@ -240,9 +240,14 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void OnElementPrepared(IControl element) |
|
|
|
public void OnElementPrepared(IControl element, VirtualizationInfo virtInfo) |
|
|
|
{ |
|
|
|
_scroller?.RegisterAnchorCandidate(element); |
|
|
|
// WinUI registers the element as an anchor candidate here, but I feel that's in error:
|
|
|
|
// at this point the element has not yet been positioned by the arrange pass so it will
|
|
|
|
// have its previous position, meaning that when the arrange pass moves it into its new
|
|
|
|
// position, an incorrect scroll anchoring will occur. Instead signal that it's not yet
|
|
|
|
// registered as a scroll anchor candidate.
|
|
|
|
virtInfo.IsRegisteredAsAnchorCandidate = false; |
|
|
|
} |
|
|
|
|
|
|
|
public void OnElementCleared(IControl element) |
|
|
|
@ -373,6 +378,11 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void RegisterScrollAnchorCandidate(IControl element) |
|
|
|
{ |
|
|
|
_scroller?.RegisterAnchorCandidate(element); |
|
|
|
} |
|
|
|
|
|
|
|
private IControl GetImmediateChildOfRepeater(IControl descendant) |
|
|
|
{ |
|
|
|
var targetChild = descendant; |
|
|
|
|