Question

WrapPanel is not supported by WinRT, as such I am using this code: http://www.codeproject.com/Articles/24141/WrapPanel-for-Silverlight-2-0

I've found a problem with using this code in a Grid. Any controls rendered in the row after I place the WrapPanel in, render OVER the WrapPanel in the same row.

It's almost as though the Grid doesn't recognise that WrapPanel is rendering content and so all controls in the following rows take it's place.

See image as an example.

enter image description here

Any ideas on how to resolve this?

Was it helpful?

Solution

Seems like the implementation you are using doesn't measure the size of the panel correctly. If the size it returns from a measure pass is 0 then the Grid with RowDefinition Height="Auto" will make a row with a height of 0, so if anything gets rendered in that row that isn't clipped - it will render under the content of the next row. It seems like the WinRT XAML Toolkit version of the WrapPanel ported from Silverlight Toolkit works well for you. Here is the link for anyone else to use it too: http://winrtxamltoolkit.codeplex.com/SourceControl/changeset/view/4d568d4e4c6a#WinRTXamlToolkit/Controls/WrapPanel/WrapPanel.cs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top