diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-15 05:00:36 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-15 05:00:36 +0200 |
| commit | afe5b7a802592acb1942c606832bc36510810038 (patch) | |
| tree | c4d58d7b2ef545465687c21c149e88bc207cc363 /Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs | |
| parent | 96fe20a20e7c107473cefeda3b06950955952bec (diff) | |
| download | Tango-afe5b7a802592acb1942c606832bc36510810038.tar.gz Tango-afe5b7a802592acb1942c606832bc36510810038.zip | |
Started integration of Tango.FileSystem to FSE.
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; + } + } +} |
