diff --git a/PomoTime/App.xaml.cs b/PomoTime/App.xaml.cs index caa311f..b326378 100644 --- a/PomoTime/App.xaml.cs +++ b/PomoTime/App.xaml.cs @@ -44,6 +44,16 @@ namespace PomoTime { Frame rootFrame = Window.Current.Content as Frame; + ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; + if (localSettings.Values["MinutesLeft"] != null) + { + RunningState.MinutesLeft = (int)localSettings.Values["MinutesLeft"]; + RunningState.SecondsLeft = (int)localSettings.Values["SecondsLeft"]; + RunningState.IsRunning = (bool)localSettings.Values["IsRunning"]; + RunningState.PreviousShortBreaks = (int)localSettings.Values["PreviousShortBreaks"]; + RunningState.CurrentPeriod = (Period)localSettings.Values["CurrentPeriod"]; + } + // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) @@ -55,17 +65,7 @@ namespace PomoTime if (e.PreviousExecutionState == ApplicationExecutionState.Terminated || e.PreviousExecutionState == ApplicationExecutionState.ClosedByUser) - { - ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; - if (localSettings.Values["MinutesLeft"] != null) - { - RunningState.MinutesLeft = (int)localSettings.Values["MinutesLeft"]; - RunningState.SecondsLeft = (int)localSettings.Values["SecondsLeft"]; - RunningState.IsRunning = (bool)localSettings.Values["IsRunning"]; - RunningState.PreviousShortBreaks = (int)localSettings.Values["PreviousShortBreaks"]; - RunningState.CurrentPeriod = (Period)localSettings.Values["CurrentPeriod"]; - } - } + {} // Place the frame in the current Window Window.Current.Content = rootFrame; @@ -87,16 +87,6 @@ namespace PomoTime { var toastActivationArgs = e as ToastNotificationActivatedEventArgs; - ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; - if (localSettings.Values["MinutesLeft"] != null) - { - RunningState.MinutesLeft = (int)localSettings.Values["MinutesLeft"]; - RunningState.SecondsLeft = (int)localSettings.Values["SecondsLeft"]; - RunningState.IsRunning = (bool)localSettings.Values["IsRunning"]; - RunningState.PreviousShortBreaks = (int)localSettings.Values["PreviousShortBreaks"]; - RunningState.CurrentPeriod = (Period)localSettings.Values["CurrentPeriod"]; - } - QueryString args = QueryString.Parse(toastActivationArgs.Argument); if (args.Contains("action")) { diff --git a/PomoTime/Package.appxmanifest b/PomoTime/Package.appxmanifest index b3ab4d6..1f2b920 100644 --- a/PomoTime/Package.appxmanifest +++ b/PomoTime/Package.appxmanifest @@ -9,7 +9,7 @@ + Version="1.0.11.0" />