diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-14 11:04:04 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-14 11:04:04 +0200 |
| commit | ba6d824eb0943d4d6643e52c844e43190da893c4 (patch) | |
| tree | 16316baae6d68a9a56c45f11354592cece99410a /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | a42f2ebe0053a912ac8c14fd05831b8fae8e0506 (diff) | |
| parent | b6283ab40fafa8e738e8e3fec260777a4d250597 (diff) | |
| download | Tango-ba6d824eb0943d4d6643e52c844e43190da893c4.tar.gz Tango-ba6d824eb0943d4d6643e52c844e43190da893c4.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingSystemViewVM.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingSystemViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingSystemViewVM.cs new file mode 100644 index 000000000..b1cb57fce --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingSystemViewVM.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.OS; + +namespace Tango.PPC.UI.ViewModels +{ + public class RestartingSystemViewVM : PPCViewModel + { + private IOperationSystemManager _os; + private INavigationManager _navigationManager; + + public RestartingSystemViewVM(IPPCApplicationManager applicationManager, IOperationSystemManager operationSystemManager, INavigationManager navigationManager) + { + _navigationManager = navigationManager; + _os = operationSystemManager; + applicationManager.SystemRestartRequired += ApplicationManager_SystemRestartRequired; + } + + private void ApplicationManager_SystemRestartRequired(object sender, EventArgs e) + { + InvokeUI(() => + { + _navigationManager.NavigateTo(NavigationView.RestartingSystemView); + }); + } + + public async override void OnNavigatedTo() + { + base.OnNavigatedTo(); + await Task.Delay(2000); + _os.Restart(); + } + + public override void OnApplicationStarted() + { + + } + } +} |
