<Window x:Class="GridSplitter.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="GridSplitters" Height="379" Width="538">
	<DockPanel>
		<DockPanel.Resources>
			<x:Array x:Key="myResizeBehavior" x:Type="{x:Type GridResizeBehavior}">
				<x:Static Member="GridResizeBehavior.BasedOnAlignment"/>
				<x:Static Member="GridResizeBehavior.CurrentAndNext"/>
				<x:Static Member="GridResizeBehavior.PreviousAndCurrent"/>
				<x:Static Member="GridResizeBehavior.PreviousAndNext"/>
			</x:Array>
			<x:Array x:Key="myResizeDirection" x:Type="{x:Type GridResizeDirection}">
				<x:Static Member="GridResizeDirection.Auto"/>
				<x:Static Member="GridResizeDirection.Columns"/>
				<x:Static Member="GridResizeDirection.Rows"/>
			</x:Array>
			<x:Array x:Key="myHorizontalAlignment" x:Type="{x:Type HorizontalAlignment}">
				<x:Static Member="HorizontalAlignment.Left"/>
				<x:Static Member="HorizontalAlignment.Center"/>
				<x:Static Member="HorizontalAlignment.Right"/>
				<x:Static Member="HorizontalAlignment.Stretch"/>
			</x:Array>
			<x:Array x:Key="myVerticalAlignment" x:Type="{x:Type VerticalAlignment}">
				<x:Static Member="VerticalAlignment.Top"/>
				<x:Static Member="VerticalAlignment.Center"/>
				<x:Static Member="VerticalAlignment.Bottom"/>
				<x:Static Member="VerticalAlignment.Stretch"/>
			</x:Array>
		</DockPanel.Resources>

		<ScrollViewer DockPanel.Dock="Right">
			<StackPanel>
				<GroupBox BorderBrush="Red">
					<StackPanel>
						<GroupBox Header="ResizeBehavior">
							<ListBox SelectedIndex="0" Margin="1" Name="redResBeh" ItemsSource="{StaticResource myResizeBehavior}" ></ListBox>
						</GroupBox>
						<GroupBox Header="ResizeDirection">
							<ListBox  SelectedIndex="0" Margin="1" Name="redResDir" ItemsSource="{StaticResource myResizeDirection}" ></ListBox>
						</GroupBox>
						<GroupBox Header="HorizontalAlignment">
							<ListBox SelectedIndex="0" Name="redHorAl" ItemsSource="{StaticResource myHorizontalAlignment}"></ListBox>
						</GroupBox>
						<GroupBox Header="VerticalAlignment">
							<ListBox SelectedIndex="0" Name="redVerAl" ItemsSource="{StaticResource myVerticalAlignment}"></ListBox>
						</GroupBox>
					</StackPanel>
				</GroupBox>
				<GroupBox BorderBrush="GreenYellow">
					<StackPanel>
						<GroupBox Header="ResizeBehavior">
							<ListBox SelectedIndex="0" Margin="1" Name="greenResBeh" ItemsSource="{StaticResource myResizeBehavior}" ></ListBox>
						</GroupBox>
						<GroupBox Header="ResizeDirection">
							<ListBox SelectedIndex="0" Margin="1" Name="greenResDir" ItemsSource="{StaticResource myResizeDirection}" ></ListBox>
						</GroupBox>
						<GroupBox Header="HorizontalAlignment">
							<ListBox SelectedIndex="0" Name="greenHorAl" ItemsSource="{StaticResource myHorizontalAlignment}"></ListBox>
						</GroupBox>
						<GroupBox Header="VerticalAlignment">
							<ListBox SelectedIndex="0" Name="greenVerAl" ItemsSource="{StaticResource myVerticalAlignment}"></ListBox>
						</GroupBox>
					</StackPanel>
				</GroupBox>
			</StackPanel>
		</ScrollViewer>
        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Button Grid.Row="0" Grid.Column="0"  Content="1"/>
            <Button Grid.Row="0" Grid.Column="1"  Content="2"/>
            <Button Grid.Row="0" Grid.Column="3"  Content="3"/>
            <Button Grid.Row="0" Grid.Column="4"  Content="4"/>
            <Button Grid.Row="0" Grid.Column="5"  Content="5"/>
            <Button Grid.Row="1" Grid.Column="0"  Content="6"/>
            <Button Grid.Row="1" Grid.Column="1"  Content="7"/>
            <Button Grid.Row="1" Grid.Column="3"  Content="8"/>
            <Button Grid.Row="1" Grid.Column="4"  Content="9"/>
            <Button Grid.Row="1" Grid.Column="5"  Content="10"/>
            <Button Grid.Row="2" Grid.Column="0"  Content="11"/>
            <Button Grid.Row="2" Grid.Column="1"  Content="12"/>
            <Button Grid.Row="2" Grid.Column="3"  Content="13"/>
            <Button Grid.Row="2" Grid.Column="4"  Content="14"/>
            <Button Grid.Row="2" Grid.Column="5"  Content="15"/>
            <Button Grid.Row="4" Grid.Column="0"  Content="16"/>
            <Button Grid.Row="4" Grid.Column="1"  Content="17"/>
            <Button Grid.Row="4" Grid.Column="3"  Content="18"/>
            <Button Grid.Row="4" Grid.Column="4"  Content="19"/>
            <Button Grid.Row="4" Grid.Column="5"  Content="20"/>
            <Button Grid.Row="5" Grid.Column="0"  Content="21"/>
            <Button Grid.Row="5" Grid.Column="1"  Content="22"/>
            <Button Grid.Row="5" Grid.Column="3"  Content="23"/>
            <Button Grid.Row="5" Grid.Column="4"  Content="24"/>
            <Button Grid.Row="5" Grid.Column="5"  Content="25"/>
            <GridSplitter  
                  Grid.Column="2" ResizeDirection="{Binding ElementName=redResDir, Path=SelectedItem}"
                  Width="5" Background="Red" Grid.RowSpan="6" ResizeBehavior="{Binding ElementName=redResBeh, Path=SelectedItem}" HorizontalAlignment="{Binding ElementName=redHorAl, Path=SelectedItem}" VerticalAlignment="{Binding ElementName=redVerAl, Path=SelectedItem}"></GridSplitter>

            <GridSplitter  Grid.ColumnSpan="6" ResizeDirection="{Binding ElementName=greenResDir, Path=SelectedItem}"
                  Height="5" Background="GreenYellow" Grid.Row="3" ResizeBehavior="{Binding ElementName=greenResBeh, Path=SelectedItem}" HorizontalAlignment="{Binding ElementName=greenHorAl, Path=SelectedItem}" VerticalAlignment="{Binding ElementName=greenVerAl, Path=SelectedItem}"></GridSplitter>
        </Grid>
    </DockPanel>

</Window>
