private void CreateList(string name) { if (String.IsNullOrWhiteSpace (name)) return; AppDelegate.AddActivity(); this.service.Tasklists.Insert (new TaskList { Title = name }) .FetchAsync (lr => { TaskList result = lr.GetResult(); AppDelegate.FinishActivity(); BeginInvokeOnMainThread (() => { var tasks = new TasksViewController (this.service, result); NavigationController.PushViewController (tasks, animated: true); }); }); }
private void CreateList(string name) { if (String.IsNullOrWhiteSpace(name)) { return; } AppDelegate.AddActivity(); this.service.Tasklists.Insert(new TaskList { Title = name }) .FetchAsync(lr => { TaskList result = lr.GetResult(); AppDelegate.FinishActivity(); BeginInvokeOnMainThread(() => { var tasks = new TasksViewController(this.service, result); NavigationController.PushViewController(tasks, animated: true); }); }); }
private void OnTaskListResponse(LazyResult <TaskLists> response) { TaskLists lists = null; try { lists = response.GetResult(); } catch (Exception ex) { BeginInvokeOnMainThread(ReloadComplete); AppDelegate.FinishActivity(); ShowError(ex); } if (lists == null || lists.Items == null) { AppDelegate.FinishActivity(); return; } Section section = new Section(); section.AddAll(lists.Items.Select(l => new StringElement(l.Title, () => { var tasks = new TasksViewController(this.service, l); NavigationController.PushViewController(tasks, true); }) ).Cast <Element>()); BeginInvokeOnMainThread(() => { Root.Clear(); Root.Add(section); ReloadComplete(); AppDelegate.FinishActivity(); }); }
private void OnTaskListResponse(LazyResult<TaskLists> response) { TaskLists lists = null; try { lists = response.GetResult(); } catch (Exception ex) { BeginInvokeOnMainThread (ReloadComplete); AppDelegate.FinishActivity(); ShowError (ex); } if (lists == null || lists.Items == null) { AppDelegate.FinishActivity(); return; } Section section = new Section(); section.AddAll (lists.Items.Select (l => new StringElement (l.Title, () => { var tasks = new TasksViewController (this.service, l); NavigationController.PushViewController (tasks, true); }) ).Cast<Element>()); BeginInvokeOnMainThread (() => { Root.Clear(); Root.Add (section); ReloadComplete(); AppDelegate.FinishActivity(); }); }