<UserControl x:Class="ControlExplorer.Controls.LayoutPanels.DemoUniformGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:ControlExplorer"
    xmlns:c1="using:C1.Xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480">

    <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.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="0" />
        </Grid.ColumnDefinitions>

       <Border Grid.Column="1" Grid.ColumnSpan="2" BorderThickness="0,0,0,0" 
                Background="{Binding ElementName=splitter, Path=Background}" 
                BorderBrush="{Binding ElementName=splitter, Path=Foreground}"/>

        <local:PanelGridSplitter x:Name="splitter"  Grid.Column="1" />

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

        </c1:C1UniformGrid>
    </Grid>
</UserControl>
