<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  HorizontalAlignment="Center" VerticalAlignment="Center">

<!-- Example 3-16. Shared Size Groups -->

<DockPanel Grid.IsSharedSizeScope="True">
  <DockPanel.Resources>
    <Style TargetType="TextBlock">
      <Setter Property="Margin" Value="5,3" />
    </Style>
  </DockPanel.Resources>
  <Grid DockPanel.Dock="Top">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="Auto" SharedSizeGroup="Location" />
      <ColumnDefinition Width="Auto" SharedSizeGroup="Rank" />
      <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Border Grid.Column="0" Grid.Row="0" BorderThickness="1"
            Background="LightGray" BorderBrush="Gray">
      <TextBlock>Title</TextBlock>
    </Border>
    <Border Grid.Column="1" Grid.Row="0" BorderThickness="1"
            Background="LightGray" BorderBrush="Gray">
      <TextBlock>Location</TextBlock>
    </Border>
    <Border Grid.Column="2" Grid.Row="0" BorderThickness="1"
            Grid.ColumnSpan="2"
            Background="LightGray" BorderBrush="Gray">
    </Border>
    <TextBlock Grid.Column="2" Grid.Row="0">Rank</TextBlock>

    <FrameworkElement Grid.Column="3"
       Width="{DynamicResource
                 {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />

  </Grid>
  <ScrollViewer>
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" SharedSizeGroup="Location" />
        <ColumnDefinition Width="Auto" SharedSizeGroup="Rank" />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>

      <TextBlock Grid.Column="0" Grid.Row="0" Text="Programming WPF" />
      <TextBlock Grid.Column="1" Grid.Row="0" Text="O'Reilly Media, Inc." />
      <TextBlock Grid.Column="2" Grid.Row="0">1</TextBlock>

      <TextBlock Grid.Column="0" Grid.Row="1">IanG on Tap</TextBlock>
      <TextBlock Grid.Column="1" Grid.Row="1">The Internet</TextBlock>
      <TextBlock Grid.Column="2" Grid.Row="1">2</TextBlock>
    </Grid>
  </ScrollViewer>
</DockPanel>

<!-- End of Example 3-16. -->

</Page>