using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; using Tango.Core.Helpers; using Tango.PPC.Common; using Tango.PPC.Common.BackupRestore; using Tango.PPC.Common.Navigation; namespace Tango.PPC.BackupRestore.ViewModels { public class RestoreCompletedViewVM : PPCViewModel, INavigationObjectReceiver { private RestoreResult _restoreResult; public RelayCommand RestartCommand { get; set; } public RestoreCompletedViewVM() { RestartCommand = new RelayCommand(Restart); } private void Restart() { if (_restoreResult.BackupFile.Settings.Mode == BackupMode.Jobs) { //Perform normal restart. ApplicationManager.Restart(); } else { //Perform update restart using the result path. String updater_exe = Path.Combine(_restoreResult.FolderPath, "Tango.PPC.Updater.exe"); ApplicationManager.UpdateApplication(updater_exe, PathHelper.GetStartupPath()); } } public override void OnApplicationStarted() { } public void OnNavigatedToWithObject(RestoreResult restoreResult) { _restoreResult = restoreResult; } } }