<UserControl
    x:Class="Layout.Examples.WrapGridExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Layout.Examples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">    
    <ItemsControl>
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapGrid 
                    ItemHeight="200"
                    ItemWidth="200"
                    MaximumRowsOrColumns="2" 
                    Width="400" 
                    Height="400" 
                    Background="White"/>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.Items>
            <Rectangle Fill="Red" Width="250" Height="125"/>
            <Rectangle Fill="Green" Width="150" Height="75"/>
            <Ellipse Fill="Blue" Width="250" Height="250"/>
        </ItemsControl.Items>
    </ItemsControl>
</UserControl>
