I have a WPF form with the stackpanel(name is MainStackPanel) as the parent. It has various groupboxes as its children. each groupbox has two checkboxes(checkbox1 and checkbox2).
Now I want to add a check all button to the Mainstack Panel which when clicked will automatically check all the checkbox1 in each group.
I am new to WPF and trying to find out how to achieve this
<EDIT>
<StackPanel x:Name="MainStackPanel" Orientation="Vertical">
<Grid DataContext="{Binding}">
<Button Content="UnCheck All" Height="23" Name="uncheckall"
Width="75" Margin="434,0,492,0" />
<Button Content="Check All" Height="23" Name="checkall" Width="75"
Margin="175,0,751,0" Click="checkall_Click" />
</Grid>
<GroupBox>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<CheckBox x:Name="checkbox1"
Style="{StaticResource styleCheckBoxLeftSideText}"
IsChecked="{Binding Path=Disabled,
Converter={StaticResource BooleanConverter},
ConverterParameter='false,true'}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Content="Task Enabled:"
Margin="9,0,0,0"/>
</Grid>
</GroupBox>
</StackPanel>
</EDIT>