Browse Source

Hack around problem with Item 0 being shown...

...when switching to a scrolled UniformGridLayout.
pull/2603/head
Steven Kirk 7 years ago
parent
commit
f09683cf93
  1. 7
      src/Avalonia.Layout/UniformGridLayoutState.cs

7
src/Avalonia.Layout/UniformGridLayoutState.cs

@ -71,6 +71,13 @@ namespace Avalonia.Layout
}
_cachedFirstElement.Measure(availableSize);
// This doesn't need to be done in the UWP version and I'm not sure why. If we
// don't do this here, and we receive a recycled element then it will be shown
// at its previous arrange point, but we don't want it shown at all until its
// arranged.
_cachedFirstElement.Arrange(new Rect(-10000.0, -10000.0, 0, 0));
SetSize(_cachedFirstElement, layoutItemWidth, LayoutItemHeight, availableSize, stretch, orientation, minRowSpacing, minColumnSpacing);
// See if we can move ownership to the flow algorithm. If we can, we do not need a local cache.

Loading…
Cancel
Save