void SelectedAllowedTermsCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (e.NewItems != null) { foreach (var item in e.NewItems) { var term = item as AimTemplateTreeAllowedTerm; if (term != null && CheckBoxControls.ContainsKey(term)) { CheckBoxControls[term].IsChecked = true; } } } if (e.OldItems != null) { foreach (var item in e.OldItems) { var term = item as AimTemplateTreeAllowedTerm; if (term != null && CheckBoxControls.ContainsKey(term)) { CheckBoxControls[term].IsChecked = false; } } } if (ImagingObservation.SelectedAllowedTerms.Count > 0) { _comboBox.SelectedItem = ImagingObservation.SelectedAllowedTerms[0]; } }
private void CheckBoxInitialized(object sender, EventArgs e) { var term = ((CheckBox)sender).Content as AimTemplateTreeAllowedTerm; if (term != null) { if (ImagingObservation.SelectedAllowedTerms.Contains(term)) { ((CheckBox)sender).IsChecked = true; } CheckBoxControls.Add(term, (CheckBox)sender); } }
private void CheckBoxInitialized(object sender, EventArgs e) { var term = ((CheckBox)sender).Content as CharacteristicQuantificationAllowedTerm; if (term != null) { if (Characteristic.SelectedCharacteristicQuantificationAllowedTerms.Contains(term)) { ((CheckBox)sender).IsChecked = true; } CheckBoxControls.Add(term, (CheckBox)sender); } }
void SelectedAllowedTermsCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (e.NewItems != null) { foreach (var item in e.NewItems) { var term = item as CharacteristicQuantificationAllowedTerm; if (term != null && CheckBoxControls.ContainsKey(term)) { CheckBoxControls[term].IsChecked = true; } } } if (e.OldItems != null) { foreach (var item in e.OldItems) { var term = item as CharacteristicQuantificationAllowedTerm; if (term != null && CheckBoxControls.ContainsKey(term)) { CheckBoxControls[term].IsChecked = false; } } } if (Characteristic.SelectedCharacteristicQuantificationAllowedTerms.Count > 0) { _comboBox.SelectedItem = Characteristic.SelectedCharacteristicQuantificationAllowedTerms[0]; } ClearQuantificationDetailsControls(); foreach (var term in Characteristic.SelectedCharacteristicQuantificationAllowedTerms) { foreach (var quantification in term.CharacteristicQuantifications) { var characteristicControl = new CharacteristicQuantificationDetailsWpfControl(quantification); _stackPanel.Children.Add(characteristicControl); } } }