I have a WPF app with a few checkboxes. I am able to set the IsChecked property in XAML, however, when I go to set it programatically, there is no such property. From everything I read, this property (IsChecked) is how I should be setting the value.
The XAML is below:
<StackPanel Orientation="Horizontal">
<Label FontWeight="Bold">Alarm 1</Label>
<CheckBox Name="ckbAlarm1" VerticalAlignment="Center"></CheckBox>
</StackPanel>
if (Regex.Matches(alarm1Data.ToString(), "ALARM 1 DISABLED").Count == 1)
{
spAlarm1.IsEnabled = false;
// ckbAlarm1.IsChecked = false; // <--- property not found
}
Aucun commentaire:
Enregistrer un commentaire