这就是我所拥有的:
<ItemsControl x:Name="InfoGrid">
<!-- ItemsPanelTemplate -->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="4" Columns="5" Background="LightGray" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!-- ItemTemplate -->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Black" BorderThickness="{Binding Path=BorderThickness}">
<CheckBox Style="{StaticResource styleCustomCheckBox}" IsChecked="{Binding Path=IsChecked, Mode=TwoWay}"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
InfoGrid的itemsource设置为后面代码中名为infoData的集合,如何通过C#设置此UniformGrid的行/列(最好是不包含在infoData中的变量)?
我尝试使用setter进行绑定,但似乎没有应用这些值。