Beispiel #1
0
        public DirectoryStructureViewModel()
        {
            // Get the logical data
            var children = DirectoryStructure.GetLogicalDrives();

            // Create the view models for the data
            this.Items = new ObservableCollection <DirectoryItemViewModel>(children.Select(drive => new DirectoryItemViewModel(drive.FullPath, DirectoryItemType.Drive)));
        }
Beispiel #2
0
        /// <summary>
        /// Expands this directory and finds all children
        /// </summary>

        private void Expand()
        {
            //We cannot expand a file
            if (this.Type == DirectoryItemType.File)
            {
                return;
            }

            //Find all children
            var children = DirectoryStructure.GetDirectoryContent(this.FullPath);

            this.Children = new ObservableCollection <DirectoryItemViewModel> (children.Select(content => new DirectoryItemViewModel(content.FullPath, content.Type)));
        }