private void treeViewItem_Selected(object sender, RoutedEventArgs e) { var treeView = (System.Windows.Controls.TreeView)e.Source; CustomTreeViewItem selectedItem = (CustomTreeViewItem)treeView.SelectedItem; if (OnSelectionChange != null) { OnSelectionChange(this, new CustomTreeViewEventArgs(selectedItem)); } }
//AddFilesToFolder_Click private void AddToGroup_Click(object sender, RoutedEventArgs e) { var id = (int)((MenuItem)e.Source).Tag; CustomTreeViewItem selectedItem = _items.Where(p => p.ID == id).FirstOrDefault(); if (OnAddToGroup != null) { OnAddToGroup(this, new CustomTreeViewEventArgs(selectedItem)); } }
public CustomTreeViewEventArgs(CustomTreeViewItem item) { _Item = item; }