From d4ecacf4f5e3402cb6124dd5afdc657c6b80cd20 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 3 May 2021 17:37:32 +0100 Subject: [PATCH] change the default value for CurrentTime property in ViewModel. I previously set CurrentTime to the current time on the system. I've changed it to 'Not Set' so dev's can identify any configuration errors. I've done this because I fell foul to that problem already. When I was initialising MainPageVM, I was using DateTime.Now as the default value and when initialising it in the View class (MainPage.xaml.cs). This confused me because I couldn't understand why the time wouldn't update when I change the code. Basically, I was updating MainPageVM because the time displayed on the dashboard matched what I set it as in the ViewModel. But, the time was being changed in the View class (at run-time) with the DateTime.Now property. --- src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs b/src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs index cc07749..789ba1c 100644 --- a/src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs +++ b/src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs @@ -26,7 +26,7 @@ namespace EyesAndEars.UWP.ViewModels { Device4 = g1; Device5 = g2; Device6 = g3; - CurrentTime = DateTime.Now.ToShortTimeString(); + CurrentTime = "Not Set"; } string _currentTime;