- WPF layout problem with Grid.IsSharedSizeScope and ItemsControl.ItemTemplate
- <Grid Grid.IsSharedSizeScope="True" >
- <Grid.RowDefinitions>
- <RowDefinition SharedSizeGroup="RowOne" />
- <RowDefinition SharedSizeGroup="RowTwo" />
- <RowDefinition SharedSizeGroup="RowThree" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <SomeControl Grid.Row="0" Grid.Column="0" />
- <SomeControl Grid.Row="1" Grid.Column="0" />
- <ItemsControl Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" ItemsSource="{Binding Path=SomeSource}" ItemsPanel="{StaticResource MyHorizontalStackPanel}" >
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition SharedSizeGroup="RowOne" />
- <RowDefinition SharedSizeGroup="RowTwo" />
- <RowDefinition SharedSizeGroup="RowThree" />
- </Grid.RowDefinitions>
- <SomeControl Grid.Row="0" />
- <SomeControl Grid.Row="1" />
- <SomeControl Grid.Row="2" />
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
- <Grid DockPanel.Dock="Top"
- Grid.IsSharedSizeScope="True">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0"
- Margin="0,10,10,0">
- <Grid.RowDefinitions>
- <RowDefinition SharedSizeGroup="RowOne" />
- <RowDefinition SharedSizeGroup="RowTwo" />
- <RowDefinition SharedSizeGroup="RowThree" />
- </Grid.RowDefinitions>
- <SomeControl Grid.Row="0" Grid.Column="0" />
- <SomeControl Grid.Row="1" Grid.Column="0" />
- </Grid>
- <ItemsControl Grid.Column="1" ItemsSource="{Binding Path=SomeSource}" ItemsPanel={StaticResource MyHorizontalStackPanel} >
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition SharedSizeGroup="RowOne"
- Height="Auto" />
- <RowDefinition SharedSizeGroup="RowTwo"
- Height="Auto" />
- <RowDefinition SharedSizeGroup="RowThree"
- Height="Auto" />
- </Grid.RowDefinitions>
- ...
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>