aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/BackupRestoreViewVM.cs91
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs11
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