|
|
@ -556,7 +556,6 @@ namespace Avalonia.Controls |
|
|
GetItemIsOwnContainer(items, index) ?? |
|
|
GetItemIsOwnContainer(items, index) ?? |
|
|
GetRecycledElement(items, index) ?? |
|
|
GetRecycledElement(items, index) ?? |
|
|
CreateElement(items, index); |
|
|
CreateElement(items, index); |
|
|
InvalidateHack(e); |
|
|
|
|
|
return e; |
|
|
return e; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -705,39 +704,6 @@ namespace Avalonia.Controls |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static void InvalidateHack(Control c) |
|
|
|
|
|
{ |
|
|
|
|
|
bool HasInvalidations(Control c) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!c.IsMeasureValid) |
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < c.VisualChildren.Count; ++i) |
|
|
|
|
|
{ |
|
|
|
|
|
if (c.VisualChildren[i] is Control child) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!child.IsMeasureValid || HasInvalidations(child)) |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Invalidate(Control c) |
|
|
|
|
|
{ |
|
|
|
|
|
c.InvalidateMeasure(); |
|
|
|
|
|
for (var i = 0; i < c.VisualChildren.Count; ++i) |
|
|
|
|
|
{ |
|
|
|
|
|
if (c.VisualChildren[i] is Control child) |
|
|
|
|
|
Invalidate(child); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (HasInvalidations(c)) |
|
|
|
|
|
Invalidate(c); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void OnUnrealizedFocusedElementLostFocus(object? sender, RoutedEventArgs e) |
|
|
private void OnUnrealizedFocusedElementLostFocus(object? sender, RoutedEventArgs e) |
|
|
{ |
|
|
{ |
|
|
if (_unrealizedFocusedElement is null || sender != _unrealizedFocusedElement) |
|
|
if (_unrealizedFocusedElement is null || sender != _unrealizedFocusedElement) |
|
|
|