Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| <Window | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| x:Class="grid_issharedsizescope_prop.Window1" | |
| Title="Grid IsSharedSizeScope Sample"> | |
| <Border BorderBrush="Black" Background="White" BorderThickness="2"> | |
| <!-- <Snippet1> --> | |
| <DockPanel Name="dp1" Grid.IsSharedSizeScope="False" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10"> | |
| <!-- </Snippet1> --> | |
| <TextBlock FontSize="20" FontWeight="Bold" DockPanel.Dock="Top">Grid IsSharedSizeScope Sample</TextBlock> | |
| <TextBlock TextWrapping="Wrap" DockPanel.Dock="Top" Margin="10">Use the button controls below to manipulate the value of the IsSharedSizeScope property. When enabled, | |
| this property allows multiple Grids to share sizing information for rows and columns.</TextBlock> | |
| <!-- <Snippet2> --> | |
| <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> | |
| <Button Click="setTrue" Margin="0,0,10,10">Set IsSharedSizeScope="True"</Button> | |
| <Button Click="setFalse" Margin="0,0,10,10">Set IsSharedSizeScope="False"</Button> | |
| </StackPanel> | |
| <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> | |
| <Grid ShowGridLines="True" Margin="0,0,10,0"> | |
| <Grid.ColumnDefinitions> | |
| <ColumnDefinition SharedSizeGroup="FirstColumn"/> | |
| <ColumnDefinition SharedSizeGroup="SecondColumn"/> | |
| </Grid.ColumnDefinitions> | |
| <Grid.RowDefinitions> | |
| <RowDefinition Height="Auto" SharedSizeGroup="FirstRow"/> | |
| </Grid.RowDefinitions> | |
| <Rectangle Fill="Silver" Grid.Column="0" Grid.Row="0" Width="200" Height="100"/> | |
| <Rectangle Fill="Blue" Grid.Column="1" Grid.Row="0" Width="150" Height="100"/> | |
| <TextBlock Grid.Column="0" Grid.Row="0" FontWeight="Bold">First Column</TextBlock> | |
| <TextBlock Grid.Column="1" Grid.Row="0" FontWeight="Bold">Second Column</TextBlock> | |
| </Grid> | |
| <Grid ShowGridLines="True"> | |
| <Grid.ColumnDefinitions> | |
| <ColumnDefinition SharedSizeGroup="FirstColumn"/> | |
| <ColumnDefinition SharedSizeGroup="SecondColumn"/> | |
| </Grid.ColumnDefinitions> | |
| <Grid.RowDefinitions> | |
| <RowDefinition Height="Auto" SharedSizeGroup="FirstRow"/> | |
| </Grid.RowDefinitions> | |
| <Rectangle Fill="Silver" Grid.Column="0" Grid.Row="0"/> | |
| <Rectangle Fill="Blue" Grid.Column="1" Grid.Row="0"/> | |
| <TextBlock Grid.Column="0" Grid.Row="0" FontWeight="Bold">First Column</TextBlock> | |
| <TextBlock Grid.Column="1" Grid.Row="0" FontWeight="Bold">Second Column</TextBlock> | |
| </Grid> | |
| </StackPanel> | |
| <TextBlock Margin="10" DockPanel.Dock="Top" Name="txt1"/> | |
| <!-- </Snippet2> --> | |
| </DockPanel> | |
| </Border> | |
| </Window> |