Reputation: 12268
When I create a grid using both a SharedSizeGroup on columns and a column spanning control, the grid goes 'mental' jerking around and maxing out a cpu core.
I'm sure there must be a good reason why this doesn't work but I can't think of it! How else can I achieve this sizing layout?
<Grid IsSharedSizeScope="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Columns"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Columns"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Column="0">Blah</Label>
<Label Grid.Column="1">Blah Blah Blah Blah</Label>
<Label Grid.Row="1" Grid.ColumnSpan="2">ajsgdeererajgsfdg dfg df gdfg djgsad</Label>
</Grid>
Upvotes: 3
Views: 2373
Reputation: 24453
What you've done is essentially set up infinite recursion in your layout.
SharedSizeGroup is intended to be used across different Grids to maintain alignment of elements that are somehow separated into different containers, like different templated list items or a header row. If you need an equally split row that isn't stretched you could use something else like * sized columns or a UniformGrid instead.
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Rows="1" HorizontalAlignment="Left">
<Label >Blah</Label>
<Label >Blah Blah Blah Blah</Label>
</UniformGrid>
<Label Grid.Row="1">ajsgdeererajgsfdg dfg df gdfg djgsad</Label>
</Grid>
Upvotes: 4