UniformGrid Coming to WinRT and Silverlight Controls

by Avatar Bill Henning (Actipro) - 1 comment
Thursday, May 1, 2014 at 7:12am

PostBannerWinRTControlsDevNotes

We've been working on some new controls and while developing one in particular that we'll post about next time, we had a need for a UniformGrid panel.  The UniformGrid panel is already available in native WPF, but isn't available in WinRT/XAML or Silverlight. 

For the next maintenance releases of our WinRT/XAML and Silverlight controls, we rolled our own UniformGrid that has the same properties as the WPF version, making it easy to reuse code across platforms.

Features

The UniformGrid automatically lays out items in a grid such that the row and column counts are the same, and each item in the panel has the same size.

UniformGrid2x2

In this screenshot, the panel has four items in it.  Thus a 2x2 grid is created to display them all.

UniformGrid3x3

In this screenshot, we have seven items so a larger grid is necessary.  A 3x3 grid is used instead.

You also have the option to specify a certain number of rows or columns that should be used.

UniformGrid2Columns

In this screenshot, we have specified that two columns should be used.  The panel therefore creates a 2x4 grid (two columns and four rows).  Note that regardless of layout, items always appear in the same size.

You can see that UniformGrid provides for a lot of interesting layout scenarios, especially when you tell it a certain number of rows or columns to use.

Summary

The UniformGrid panel will be available in the next maintenance release of our WinRT/XAML and Silverlight Shared Libraries and is licensed for use by any of our customers of those control platforms.

Our next blog post will show off another new control coming to our XAML platforms that makes use of this new panel.

TaskDownload TaskLiveDemo TaskBuyNow

Comments (1)

Posted 5 years ago by (Anonymous)
Avatar
It's a bit like my UniformSquareGrid panel: https://winrtxamltoolkit.codeplex.com/SourceControl/latest#WinRTXamlToolkit/Controls/UniformSquareGrid/UniformSquareGrid.cs

Add Comment

Please log in to a validated account to post comments.