/// <summary> /// This method will be called when the "IsSelected" property of an SelectorItem /// has been modified. /// </summary> /// <param name="args"></param> protected virtual void OnItemSelectionChanged(ItemSelectionChangedEventArgs args) { if (_surpressItemSelectionChanged) { return; } RaiseEvent(args); }
private void ElementType_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e) { if (handleSelection) { handleSelection = false; ItemSelectionChanged(e, ElementType); } handleSelection = true; if (!select_all) { list_type.Clear(); foreach (var i in ElementType.SelectedItems) { if (!i.ToString().Equals("Select All")) { list_type.Add(i.ToString()); } } RemoveSelection(e, Group); RemoveSelection(e, View); RemoveSelection(e, Element); if (select_all) { _elements = fileGenerator.getAllElements(); element_id = fileGenerator.getAllElementID(); Element.Items.Clear(); Element.Items.Add("Select All"); //foreach (var i in _elements) //{ // Dictionary<string, Element> dict = new Dictionary<string, Element>(fileGenerator.Dict_element); // string key = dict.First(x => x.Value.Name_.Equals(i)).Key; // string type = dict[key].Type_; // dict.Remove(key); // Element.Items.Add(i + "(" + type + ")"); //} List <string> list = new List <string>(); foreach (var i in element_id) { list.Add(fileGenerator.Dict_element[i].Name_ + "(" + fileGenerator.Dict_element[i].Type_ + ")"); } list.Sort(); foreach (var i in list) { Element.Items.Add(i); } } else { UpdateGroups(); UpdateViews(); UpdateElements(); } } }
/// <summary> /// This method will be called when the "IsSelected" property of an SelectorItem /// has been modified. /// </summary> /// <param name="args"></param> protected virtual void OnItemSelectionChanged(ItemSelectionChangedEventArgs args) { if (_surpressItemSelectionChanged) { return; } RaiseEvent(args); if (Command != null) { Command.Execute(args.Item); } }