21
votes

A XAML StackPanel aligns controls side-by-side in a single direction. A WrapPanel is similar but like TextWrapping="Wrap" in a XAML TextBox the controls "wrap" to the next column or row when the respective height or width is reached.

enter image description here

Similar, but not the same, WrapGrid wraps content, but in a uniform grid. Though the VariableSizedWrapGrid allows for dissimilar items in the container. Neither of the WrapGrids can be used outside of an ItemsControl. So, they are disqualified.

When developers look in their native XAML Toolbox in Visual Studio there is no WrapPanel. WPF developers had a WrapPanel so they might be looking for this common tool to solve their scenario. So, I have to ask:

Does anyone know of a WrapPanel in XAML-WinRT? (what about one that is virtualized?)

2
+1 I have been looking for this very same thing. It is a pain to have to manually set the rows and columns of each item in a gridview. I think it can be done by overriding ArrangeOveride. I had a failed attempt at it once, and haven't looked at it again. ArrangeOverride at MSDN: msdn.microsoft.com/en-us/library/windows/apps/… - chue x

2 Answers

9
votes

There is one in WinRT XAML Toolkit here. It was ported from Silverlight Toolkit.

0
votes

I had a same requirement and after googled it for a while, I've decided to use custom control for this. Please find following link for implementation:

http://www.codeproject.com/Articles/463860/WinRT-Custom-WrapPanel

Hope this will help you.