Ejemplo n.º 1
0
        public DirectoryStructureViewModel()
        {
            var drives = DirectoryStructure.GetLogicalDrives();

            Items = new ObservableCollection <DirectoryItemViewModel>(
                drives.Select(
                    child => new DirectoryItemViewModel(
                        child.FullPath,
                        DirectoryItemType.Drive)));
        }
 /// <summary>
 /// Default constructor.
 /// </summary>
 public DirectoryStructureViewModel()
 {
     Items = new ObservableCollection <DirectoryItemViewModel>
             (
         DirectoryStructure.GetLogicalDrives().Select
         (
             item => new DirectoryItemViewModel(item.FullPath, item.Type)
         )
             );
 }
        public void Update()
        {
            var expanedItems = GetExpandedItems(Items.ToList());

            Items = new ObservableCollection <DirectoryItemViewModel>
                    (
                DirectoryStructure.GetLogicalDrives().Select
                (
                    item => new DirectoryItemViewModel(item.FullPath, item.Type)
                )
                    );

            ExpandItems(expanedItems);
        }