Ok, use ItemControl with the attached property Grid.IsSharedSizeScope="true". Further, for your ItemTemplate, you use the <Grid>same as usual, but now, when you add ColumnDefinition, you set an attribute SharedSizeGroupfor a name unique to each column. For example:
<ItemsControl Grid.IsSharedSizeScope="true">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="MyFirstColumn" />
<ColumnDefinition SharedSizeGroup="MySecondColumn" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding MyFirstProperty}"/ >
<TextBlock Grid.Column="1" Text="{Binding MySecondProperty}"/ >
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
For more information about IsSharedSizeScope and SharedSizeGroup, see this section of the SDK . It should be noted that RowDefinitions also has a SharedSizeGroup so you can execute horizontal layouts.
source
share