Reputation: 4185
I am using a checkbox as follows:
<CheckBox Content="Reload Code Table Rules"
IsChecked="{Binding ReloadCodeTableRules, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center" />
Currently the checked state will change if I click on either the checkbox or the label. Is it possible to limit this to only change when the checkbox is checked?
Upvotes: 1
Views: 1133
Reputation: 13458
You could place the text in a separate TextBlock
and wrap them together in a StackPanel
:
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<CheckBox IsChecked="{Binding ReloadCodeTableRules, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
<TextBlock Margin="4,0,0,0" Text="Reload Code Table Rules" VerticalAlignment="Center"/>
</StackPanel>
Upvotes: 2