循环浏览Listbox
items
并尝试获取checkbox
控件但我无法找到。我的XAML
代码如下所示。
<ListBox Height="119" HorizontalAlignment="Left" ItemsSource="{Binding Path=mastertable}" Margin="193,10,0,0" Name="lstMyItems" VerticalAlignment="Top" Visibility="Hidden" Width="120" FontSize="12" FontWeight="Normal">
<ListBox.ItemTemplate>
<DataTemplate x:Name="DataTemplete">
<CheckBox Name="chkIsselect" Margin="0,5,0,0" Content="{Binding ItemName}" Click="chkIsselect_Click"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
和c#代码
for (int i = 0; i < lstMyItems.Items.Count; i++)
{
// Here I need acces to Checkbox.
}