public DirectoryStructureViewModel() { //Get logical drivers var children = DirectoryStructure.GetLogicalDrives(); //Create the viewmodels from the data Items = new ObservableCollection <DirectoryItemViewModel>( children.Select(drive => new DirectoryItemViewModel(drive.FullPath, DirectoryItemType.Drive))); }
private void Expand() { if (this.Type == DirectoryItemType.File) { return; } //Find all children for this item var children = DirectoryStructure.GetDirectoryContents(this.FullPath); this.Children = new ObservableCollection <DirectoryItemViewModel>(children.Select(x => new DirectoryItemViewModel(x.FullPath, x.Type))); }
/// <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.GetDirectoryContents(this.FullPath); this.Children = new ObservableCollection <DirectoryItemViewModel>( children.Select(content => new DirectoryItemViewModel(content.FullPath, content.Type))); }
public DirectoryStructureViewModel() { var children = DirectoryStructure.GetLogicalDrives(); this.Items = new ObservableCollection <DirectoryItemViewModel>(children.Select(drive => new DirectoryItemViewModel(drive.FullPath, DirectoryItemType.Drive))); }