/// <summary> Updates the selection checkboxes. </summary> private void UpdateSelection() { foreach (var checkBox in LayersStack.Children.Cast <UIElement>().Where(uiElement => Grid.GetColumn(uiElement) == selectionColumn).OfType <CheckBox>()) { var layer = layers[checkBox.Tag as string]; if (layers.ExclusiveSelectableLayer == null) { checkBox.IsChecked = layers.IsSelectableBase(layer); } else if (layers.ExclusiveSelectableLayer == layer) { updateByExclusiveSelection = true; checkBox.IsChecked = true; updateByExclusiveSelection = false; } else { checkBox.IsChecked = null; } } }