public DirectoryStructureViewModel() { var children = DirectoryStructure.GetLogicalDrives(); this.Items = new ObservableCollection <DirectoryItemViewModel>( children.Select(drive => new DirectoryItemViewModel(drive.FullPath, DirectoryItemType.Drive))); }
private void Expand() { if (this.Type == DirectoryItemType.File) { return; } this.Children = new ObservableCollection <DirectoryItemViewModel>(DirectoryStructure.GetDirectoryContents(this.FullPath).Select(content => new DirectoryItemViewModel(content.FullPath, content.Type))); }