/// <summary> /// Called when [selected items changed]. /// </summary> /// <param name="d">The d.</param> /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param> private static void OnSelectedItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MultiSelectComboBox control = (MultiSelectComboBox)d; control.SelectNodes(); control.SetText(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MC = ((MultiSelectComboBox.MultiSelectComboBox)(target)); return; } this._contentLoaded = true; }
private void CheckBox_Click(object sender, RoutedEventArgs e) { CheckBox clickedBox = (CheckBox)sender; MultiSelectComboBox control = (MultiSelectComboBox)clickedBox.Parent; if (clickedBox.Content == "All") { if (clickedBox.IsChecked.Value) { foreach (Node node in _nodeList) { node.IsSelected = true; } } else { foreach (Node node in _nodeList) { node.IsSelected = false; } } } else { int _selectedCount = 0; foreach (Node s in _nodeList) { if (s.IsSelected && s.Title != "All") { _selectedCount++; } } if (_selectedCount == _nodeList.Count - 1) { _nodeList.FirstOrDefault(i => i.Title == "All").IsSelected = true; } else { _nodeList.FirstOrDefault(i => i.Title == "All").IsSelected = false; } } SetSelectedItems(); SetText(); if (control != null) { control.OnSelectedItemsChanged2(sender, e); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.MC = ((MultiSelectComboBox.MultiSelectComboBox)(target)); return; case 2: this.button = ((System.Windows.Controls.Button)(target)); #line 18 "..\..\..\MainWindow.xaml" this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click); #line default #line hidden return; } this._contentLoaded = true; }
/// <summary> /// Called when [items source changed]. /// </summary> /// <param name="d">The d.</param> /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param> private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MultiSelectComboBox control = (MultiSelectComboBox)d; control.DisplayInControl(); }