I'm building C# WPF application with many CheckBoxes in it contained in different Grids. Here's an sample of the XAML code:
<Grid x:Name="grid1">
<CheckBox x:Name="box1" Content="Box 1"/>
</Grid>
<Grid>
<Grid x:Name="grid4">
<CheckBox x:Name="box12" Content="Box 12"/>
</Grid>
</Grid>
and so on.
In the code-behind I need to get a list of the boxes with property IsChecked="True" by count_btn_Click()
I've tried everything I could and found nothing. (Please remember I'm just an amateur so put more description if possible).
UPD1 (to the Charles Mager's comment): Is there a more simple way? E.g. if I have a predefined list of checkboxes' names.