Browse Source

Make it clear that MaxClientSize is used when available

pull/899/head
Nikita Tsukanov 9 years ago
parent
commit
657c53fb73
  1. 8
      src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs

8
src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs

@ -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

Loading…
Cancel
Save