diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-03-15 16:22:40 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-03-15 16:22:40 +0200 |
| commit | e5accfce2c661fab649bb57c33b63c679a67e60c (patch) | |
| tree | 1f29c4d77fd8e70736f4745b86a30abcf9bb3fd0 /Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs | |
| parent | 56678ae530fe45b0880053793ab46f47051e4dc6 (diff) | |
| parent | b188d7bfd91062f65474bd139bb8a434694f117b (diff) | |
| download | Tango-e5accfce2c661fab649bb57c33b63c679a67e60c.tar.gz Tango-e5accfce2c661fab649bb57c33b63c679a67e60c.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs new file mode 100644 index 000000000..44bd03c39 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.FileSystem; +using Tango.FSE.Common; + +namespace Tango.FSE.PPCConsole.ViewModels +{ + public class FileSystemViewVM : FSEViewModel + { + private FileSystemItem _currentItem; + public FileSystemItem CurrentItem + { + get { return _currentItem; } + set { _currentItem = value; RaisePropertyChangedAuto(); OnCurrentItemChanged(); } + } + + private String _currentPath; + public String CurrentPath + { + get { return _currentPath; } + set { _currentPath = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand NavigateCommand { get; set; } + + public FileSystemViewVM() + { + NavigateCommand = new RelayCommand(Navigate); + } + + public override void OnApplicationReady() + { + base.OnApplicationReady(); + + FileSystemManager manager = new FileSystemManager(); + CurrentItem = FileSystemItem.FromDTO(manager.GetFolder(@"C:\")); + } + + private void Navigate() + { + if (CurrentPath.IsNotNullOrEmpty()) + { + FileSystemManager manager = new FileSystemManager(); + CurrentItem = FileSystemItem.FromDTO(manager.GetFolder(CurrentPath)); + } + } + + private void OnCurrentItemChanged() + { + CurrentPath = CurrentItem.Path; + } + } +} |
