From 6fb22273d15ed476ccbd3820de6af9bc0deee793 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 26 Nov 2018 14:19:06 +0200 Subject: Implemented Application Initialization Error and Handling. --- .../Tango.PPC.UI/ViewModels/LoadingErrorViewVM.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingErrorViewVM.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingErrorViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingErrorViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingErrorViewVM.cs new file mode 100644 index 000000000..3c05e3690 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingErrorViewVM.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.PPC.Common; +using Tango.PPC.Common.Navigation; + +namespace Tango.PPC.UI.ViewModels +{ + public class LoadingErrorViewVM : PPCViewModel, INavigationObjectReceiver + { + private String _error; + public String Error + { + get { return _error; } + set { _error = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand RestartCommand { get; set; } + + public LoadingErrorViewVM() + { + RestartCommand = new RelayCommand(Restart); + } + + public override void OnApplicationStarted() + { + + } + + public void OnNavigatedToWithObject(Exception ex) + { + Error = ex.Message; + } + + private void Restart() + { + ApplicationManager.Restart(); + } + } +} -- cgit v1.3.1