mardi 19 janvier 2016

Check if All CheckBoxes Are Unchecked C# WPF

I would like to perform a task if all CheckBoxes in a StackPanel are unchecked. Currently I am doing something like this;

foreach (CheckBox c in _employees.Children)
{
    if (c.IsChecked == false)
    {
        // do something
    }
}

However of course this says that do something every time it comes across a CheckBox that is false. Is there a way I can say do something only if ALL the CheckBoxes are not checked, instead of evaluating them all individually?

Aucun commentaire:

Enregistrer un commentaire