|
|
|
@ -28,7 +28,7 @@ namespace Avalonia.Layout |
|
|
|
public LayoutManager(ILayoutRoot owner) |
|
|
|
{ |
|
|
|
_owner = owner ?? throw new ArgumentNullException(nameof(owner)); |
|
|
|
_executeLayoutPass = ExecuteLayoutPass; |
|
|
|
_executeLayoutPass = ExecuteQueuedLayoutPass; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual event EventHandler? LayoutUpdated; |
|
|
|
@ -94,6 +94,16 @@ namespace Avalonia.Layout |
|
|
|
QueueLayoutPass(); |
|
|
|
} |
|
|
|
|
|
|
|
private void ExecuteQueuedLayoutPass() |
|
|
|
{ |
|
|
|
if (!_queued) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
ExecuteLayoutPass(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public virtual void ExecuteLayoutPass() |
|
|
|
{ |
|
|
|
@ -319,8 +329,8 @@ namespace Avalonia.Layout |
|
|
|
{ |
|
|
|
if (!_queued && !_running) |
|
|
|
{ |
|
|
|
Dispatcher.UIThread.Post(_executeLayoutPass, DispatcherPriority.Layout); |
|
|
|
_queued = true; |
|
|
|
Dispatcher.UIThread.Post(_executeLayoutPass, DispatcherPriority.Layout); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|