|
|
@ -97,11 +97,9 @@ namespace Avalonia.Controls.Presenters |
|
|
/// <inheritdoc/>
|
|
|
/// <inheritdoc/>
|
|
|
public override Size MeasureOverride(Size availableSize) |
|
|
public override Size MeasureOverride(Size availableSize) |
|
|
{ |
|
|
{ |
|
|
var maxAvailableSize = (Owner.GetVisualRoot() as WindowBase)?.PlatformImpl?.MaxClientSize; |
|
|
var visualRoot = Owner.GetVisualRoot(); |
|
|
if (!maxAvailableSize.HasValue) |
|
|
var maxAvailableSize = (visualRoot as WindowBase)?.PlatformImpl?.MaxClientSize |
|
|
{ |
|
|
?? (visualRoot as TopLevel)?.ClientSize; |
|
|
maxAvailableSize = (Owner.GetVisualRoot() as TopLevel)?.ClientSize; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// If infinity is passed as the available size and we're virtualized then we need to
|
|
|
// If infinity is passed as the available size and we're virtualized then we need to
|
|
|
// fill the available space, but to do that we *don't* want to materialize all our
|
|
|
// fill the available space, but to do that we *don't* want to materialize all our
|
|
|
|