我正在尝试水平对齐列表框中的项目(项目是复选框项目) . 如何使用带有datatemplate的包装面板?
<ListBox Name="Horizontal" ItemsSource="{Binding Solution}" scrollViewer.HorizontalScrollBarVisibility="Disabled" >
<ListBox.ItemTemplate >
<DataTemplate >
<CheckBox Content="{Binding Name}" IsChecked="{Binding IsChecked}" Margin="5 5 0 0"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
1 回答
我想你想要
ItemsPanel
属性: