- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
<Grid Grid.Row="2" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[0]}"/>
<ContentPresenter Grid.Row="0" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[1]}"/>
<ContentPresenter Grid.Row="0" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[2]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[3]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[4]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[5]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[6]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[7]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[8]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[9]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[10]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[11]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[12]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[13]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[14]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[15]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[16]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[17]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[18]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[19]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[20]}"/>
</Grid>
Lure Of Chaos 22.10.2011 16:24 # 0
legat 22.10.2011 16:57 # 0
Сам автор исправил на следующее
а у итемов в коде задает позицию в гриде при изменении коллекции
Joe_MD 03.11.2011 01:40 # 0
Grid.Column="{Binding SomeOtherDerivedValue}"
Em1ss1oN 24.10.2011 14:12 # 0
AxisPod 01.11.2011 07:23 # 0
Да и на худой конец есть UniformGrid. :-D
guest 01.11.2011 11:47 # +1
<ItemsControl Grid.Row="2" Margin="5" ItemsSource="{Binding ElementName=root,Path=Items}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="3"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>