<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
HorizontalAlignment="Center" VerticalAlignment="Center">
<DockPanel Grid.IsSharedSizeScope="True">
<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>A</TextBlock>
</Border>
<Border Grid.Column="1" Grid.Row="0" BorderThickness="1" Background="LightGray" BorderBrush="Gray">
<TextBlock>B</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">C</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="WPF" />
<TextBlock Grid.Column="1" Grid.Row="0" Text="this" />
<TextBlock Grid.Column="2" Grid.Row="0">is</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="1">a</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="1">test</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="1">.</TextBlock>
</Grid>
</ScrollViewer>
</DockPanel>
</Page>
|