예제 #1
0
        private void _LoadDirectory(string directoryPath)
        {
            ProgressBar1.IsIndeterminate = true;
            this.usingFileSystem         = true;
            var directory = new Control.DirectoryInfo(directoryPath, Path.GetFileName(directoryPath));

            directory.Root = PaneGroup1;
            directory.LoadChildren();
            this.treeView.ItemsSource    = (directory.Items);
            ProgressBar1.IsIndeterminate = false;
            //ExampleHelper.PopulateTreeView(this.treeView, items);
        }
예제 #2
0
        private void TreeView_LoadOnDemand(object sender, RadRoutedEventArgs e)
        {
            e.Handled = true;

            RadTreeViewItem expandedItem = e.OriginalSource as RadTreeViewItem;

            if (expandedItem == null)
            {
                return;
            }

            Control.DirectoryInfo directory = expandedItem.Item as Control.DirectoryInfo;
            if (directory != null && this.usingFileSystem)
            {
                directory.LoadChildren();
                if (directory.Items.Count == 0)
                {
                    expandedItem.IsLoadOnDemandEnabled = false;
                }
            }
        }