diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-11-25 16:39:01 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-11-25 16:39:01 +0200 |
| commit | 78c93e2ee1eddff67554edec9f956536a0b61482 (patch) | |
| tree | 208e8f9c368cfa324e255493bb287e50b79b04fa /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | ca18248f6203d7567a2276ec76360aedd4cfda0b (diff) | |
| download | Tango-78c93e2ee1eddff67554edec9f956536a0b61482.tar.gz Tango-78c93e2ee1eddff67554edec9f956536a0b61482.zip | |
Working on Backup/Restore...
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/BackupRestoreViewVM.cs | 91 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 11 |
2 files changed, 0 insertions, 102 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/BackupRestoreViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/BackupRestoreViewVM.cs deleted file mode 100644 index 416ece24b..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/BackupRestoreViewVM.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.Commands; -using Tango.Core.DI; -using Tango.PPC.Common; -using Tango.PPC.Common.BackupRestore; -using Tango.PPC.UI.ViewsContracts; - -namespace Tango.PPC.UI.ViewModels -{ - public class BackupRestoreViewVM : PPCViewModel<IBackupRestoreView> - { - private Stack<BackupRestoreView> _navigation_history; - private BackupRestoreView _currentView; - private bool _canNavigateBack; - - public enum BackupRestoreView - { - MainView, - BackupView, - RestoreView - } - - [TangoInject] - public IBackupManager BackupManager { get; set; } - - public RelayCommand<String> NavigateCommand { get; set; } - - public RelayCommand NavigateBackCommand { get; set; } - - public BackupRestoreViewVM() - { - NavigateCommand = new RelayCommand<string>(HandleNavigateCommand); - NavigateBackCommand = new RelayCommand(NavigateBack, () => _canNavigateBack); - - _navigation_history = new Stack<BackupRestoreView>(); - _canNavigateBack = true; - } - - public override void OnNavigatedTo() - { - base.OnNavigatedTo(); - - _navigation_history = new Stack<BackupRestoreView>(); - _currentView = BackupRestoreView.MainView; - } - - private void HandleNavigateCommand(string view) - { - var v = (BackupRestoreView)Enum.Parse(typeof(BackupRestoreView), view); - NavigateTo(v); - } - - private Task NavigateTo(BackupRestoreView view, bool pushHistory = true) - { - if (pushHistory) - { - _navigation_history.Push(_currentView); - } - - _currentView = view; - return View.NavigateTo(view); - } - - private async void NavigateBack() - { - _canNavigateBack = false; - InvalidateRelayCommands(); - - if (_navigation_history.Count > 0) - { - await NavigateTo(_navigation_history.Pop(), false); - } - else - { - await NavigationManager.NavigateBack(); - } - - _canNavigateBack = true; - InvalidateRelayCommands(); - } - - public override void OnApplicationStarted() - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 0b530c278..9e8a9fe34 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -112,11 +112,6 @@ namespace Tango.PPC.UI.ViewModels public RelayCommand UpdateCommand { get; set; } /// <summary> - /// Gets or sets the backup restore command. - /// </summary> - public RelayCommand BackupRestoreCommand { get; set; } - - /// <summary> /// Gets or sets the power command. /// </summary> public RelayCommand PowerCommand { get; set; } @@ -151,12 +146,6 @@ namespace Tango.PPC.UI.ViewModels PowerCommand = new RelayCommand(() => IsPowerOpened = true); RestartApplicationCommand = new RelayCommand(RestartApplication); - - BackupRestoreCommand = new RelayCommand(() => - { - NavigationManager.NavigateTo(NavigationView.BackupRestoreView); - IsMenuOpened = false; - }); } #endregion |
