public static int RunTask(NavigationFriendlyPage page, AppTask task) { int id = CurrentID++; Tuple <NavigationFriendlyPage, int, IAsyncAction, AppTask> item = new Tuple <NavigationFriendlyPage, int, IAsyncAction, AppTask>(page, id, ThreadPool.RunAsync(task.GetWorkItemHandler(page.Dispatcher)), task); return(id); }
public static int RunTask(NavigationFriendlyPage page, AppTask task) { int id = CurrentID++; Tuple<NavigationFriendlyPage, int, IAsyncAction, AppTask> item = new Tuple<NavigationFriendlyPage, int, IAsyncAction, AppTask>(page, id, ThreadPool.RunAsync(task.GetWorkItemHandler(page.Dispatcher)), task); return id; }
public static void CancelPage(NavigationFriendlyPage page) { var targets = from task in RunningTasks where task.Item1 == page select task; foreach (var task in targets) { task.Item3.Cancel(); RunningTasks.Remove(task); } }
public static void CancelPage(NavigationFriendlyPage page) { var targets = from task in RunningTasks where task.Item1 == page select task; foreach (var task in targets) { task.Item3.Cancel(); RunningTasks.Remove(task); } }