オブジェクトの配列をリストアップして、アイテムを水平方向に均等に広げたいと思います。データバインドされた配列でない場合は、適切な数の列を持つグリッドを作成し、各項目を列に割り当てます。問題は、データバインドされたリストコントロールでそれを行う方法がわからないことです。
安価な代替手段として、次のようなItemsControlのItemsPanelとしてスタックパネルを使用してアイテムを水平方向にリストします。
<ItemsControl ItemsSource="{Binding Path=ValveSettings}" Grid.Row="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Label Content="{Binding Path=Name}" Grid.Row="0" />
<ScrollBar Orientation="Vertical" Grid.Column="0" Grid.Row="1" Minimum="0" Maximum="100000" Value="{Binding Path=DelayInMicroseconds}" SmallChange="100" LargeChange="1000" />
<TextBox Text="{Binding Path=DelayInMicroseconds}" Grid.Row="2" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
それらを均等に広げる方法はありますか?