List<string>
コレクションをItemsControlに表示しています。問題は、リスト項目TheyAreAllNextToEachOtherの間にスペースがないことです。WPFのアイテム間隔ItemsControl
アイテム間の間隔をどのようにすることができますか?
<ItemsControl Grid.Column="2"
Grid.ColumnSpan="2"
ItemsSource="{Binding Path=ShowTimes}"
BorderThickness="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
あなたが現在提供されている2つの回答の違いを知っていれば、 'ItemContainerStyle'は' item container 'の 'Style'、' ListBox'を使用していれば 'ListBoxItem'です。 'ItemTemplate'はアイテムの 'contents'がどのように見えるかを定義する' DataTemplate'です。したがって、 'ItemContainerStyle'ではコンテナのプロパティ(例えばListBoxItem.IsSelected)にアクセスでき、' DataTemplate'ではデータ項目のパブリッククラスプロパティにアクセスできます。 – Sheridan