private void OnOpen(object sender, RoutedEventArgs e) { if (HelpDocTree.SelectedItem != null) { HelpDocTreeItem item = HelpDocTree.SelectedItem as HelpDocTreeItem; item.IsExpanded = true; } }
private void OnKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { HelpDocTreeItem item = HelpDocTree.SelectedItem as HelpDocTreeItem; item.IsExpanded = !item.IsExpanded; } }
private void CloseItem(HelpDocTreeItem item) { foreach (var subitem in item.Items) { CloseItem(subitem as HelpDocTreeItem); } if (item.IsExpanded) { item.IsExpanded = false; } }
private void OnMouseDoubleClick(object sender, MouseButtonEventArgs e) { HelpDocTreeItem item = sender as HelpDocTreeItem; if (item == null || !item.IsSelected) { return; } else { MouseDoubleClickEventHandler.Invoke(sender, e); } }
private void OpenItem(HelpDocTreeItem item) { item.ExpandSubtree(); }