我想找出代码检查了多少复选框:
<Grid Width="440" >
<ListBox Name="listBoxZone" ItemsSource="{Binding TheList}" Background="White" Margin="0,120,2,131">
<ListBox.ItemTemplate>
<HierarchicalDataTemplate>
<CheckBox Name="CheckBoxZone" Content="{Binding StatusName}" Tag="{Binding StatusId}" Margin="0,5,0,0" VerticalAlignment ="Top" />
</HierarchicalDataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
这是我的代码,我想在其中找到选中了多少复选框?
for (int i = 0; i < listBoxZone.Items.Count; i++)
{
if (CheckBoxZone.IsChecked == true )
{
}
}