diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-13 20:02:59 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-13 20:02:59 +0200 |
| commit | 69c55f54ee7217f16419049a311ce437d3c19157 (patch) | |
| tree | 2c0c25115e07ad4eba5dd4bb4c150fe6d1f0c702 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingSystemViewVM.cs | |
| parent | 7b371c15dfb48c5182bbb704b5ea1ff1385b1d30 (diff) | |
| download | Tango-69c55f54ee7217f16419049a311ce437d3c19157.tar.gz Tango-69c55f54ee7217f16419049a311ce437d3c19157.zip | |
Fixed issue with PPC WIFI connection profiles.
Implemented OS restart after first setup.
Prevented PPC updater crashes without restarting PPC.
Implemented restarting system view on PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/RestartingSystemViewVM.cs')
| -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() + { + + } + } +} |
