<UserControl
    x:Class="BasicLibrarySamples.View.UniformGridSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BasicLibrarySamples.View"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <UserControl.Resources>

        <!-- template used for items in the panel -->
        <ControlTemplate x:Key="PanelItemTemplate" TargetType="ContentControl">
            <Border Background="{TemplateBinding Background}" Margin="5" >
                <TextBlock Text="{TemplateBinding Content}" 
                           HorizontalAlignment="Center" 
                           VerticalAlignment="Center" 
                           FontSize="46" Foreground="WhiteSmoke"/>
            </Border>
        </ControlTemplate>

    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="0" />
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal">
            <Button Content="Add Item" x:Name="btnAddItem" Click="btnAddItem_Click" Margin="0 0 0 20" />
        </StackPanel>

        

        <c1:C1UniformGrid x:Name="panel" Grid.Row="1">
            <ContentControl Content="1" 
                        Width="150"
                        Background="#FF008B9C" 
                        Template="{StaticResource PanelItemTemplate}" />

        </c1:C1UniformGrid>

    </Grid>
</UserControl>
