private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { Model.TreeViewItem treeViewItem = e.NewValue as Model.TreeViewItem; if (treeViewItem != null && parent != treeViewItem) { if (treeViewItem.IsDirectory) { LoadFolder(treeViewItem.Children, treeViewItem.Info.FullName); } else { if (treeViewItem.IsText) { ShowText(treeViewItem.Info); } } } }
public void LoadFolder(string projectPath) { parent = new Model.TreeViewItem(new System.IO.FileInfo(projectPath)); solutionExplorerViewModel.Root.Add(parent); LoadFolder(parent.Children, projectPath); }