From e5b8fc296e738bb3f39460de66c4fa407ab493f0 Mon Sep 17 00:00:00 2001 From: jessenic Date: Thu, 29 Aug 2013 21:02:42 +0300 Subject: [PATCH] Change how the task works. --- SparklrWP Background Agent/ScheduledAgent.cs | 15 --------------- SparklrWP/App.xaml.cs | 2 +- SparklrWP/Pages/MainPage.xaml.cs | 2 ++ 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/SparklrWP Background Agent/ScheduledAgent.cs b/SparklrWP Background Agent/ScheduledAgent.cs index 90162cb..9b149bc 100644 --- a/SparklrWP Background Agent/ScheduledAgent.cs +++ b/SparklrWP Background Agent/ScheduledAgent.cs @@ -154,7 +154,6 @@ protected async override void OnInvoke(ScheduledTask task) notif.Show(); } } - NotifyComplete(); } else { @@ -167,23 +166,9 @@ protected async override void OnInvoke(ScheduledTask task) notif.Show(); } } - NotifyComplete(); } - else - { - NotifyComplete(); - } - NotifyComplete(); } } - else - { - NotifyComplete(); - } - } - else - { - NotifyComplete(); } NotifyComplete(); } diff --git a/SparklrWP/App.xaml.cs b/SparklrWP/App.xaml.cs index ff3e4ef..1bb8d67 100644 --- a/SparklrWP/App.xaml.cs +++ b/SparklrWP/App.xaml.cs @@ -17,7 +17,7 @@ public partial class App : Application private static MainViewModel mainViewModel = null; public static WPClogger logger = new WPClogger(LogLevel.debug); - public static Utils.Task BackgroundTask = new Task(); + public static Utils.Task BackgroundTask; public static SparklrClient Client = new SparklrClient(); diff --git a/SparklrWP/Pages/MainPage.xaml.cs b/SparklrWP/Pages/MainPage.xaml.cs index 62de4a4..48a5a6d 100644 --- a/SparklrWP/Pages/MainPage.xaml.cs +++ b/SparklrWP/Pages/MainPage.xaml.cs @@ -1,5 +1,6 @@ using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; +using SparklrWP.Utils; using System; using System.Windows; using System.Windows.Controls; @@ -38,6 +39,7 @@ public MainPage() this.ApplicationBar.MenuItems.Add(clearCache); this.ApplicationBar.MenuItems.Add(cleanCache); #endif + App.BackgroundTask = new Task(); } public bool didFriends = false;