private void CollapseNextLevel_Click(object sender, RoutedEventArgs e) { if (treeDepth >= 0) { treeDepth--; DataTree.CollapseAll(); DataTree.ExpandToDepth(treeDepth); } }
private void Expand_Click(object sender, RoutedEventArgs e) { if (Expand.IsChecked.HasValue && Expand.IsChecked.Value) { DataTree.ExpandAll(); Expand.Content = "收缩所有"; } else { DataTree.CollapseAll(); Expand.Content = "展开所有"; } }