async Task LoadData(bool isUserAction = false) { await LoadWorkspacesFromDb(); await LoadTasksFromDb(); await LoadUsersFromDb(); ApplicationCheckUpdateService.Check(AsanaConstants.AppId); if (NavigationEventArgs.IsBackOrReset()) { NotifyOfPropertyChange(() => Workspaces); NotifyOfPropertyChange(() => DueTodayTasks); NotifyOfPropertyChange(() => DueTomorrowTasks); NotifyOfPropertyChange(() => DueWeekendTasks); NotifyOfPropertyChange(() => MyTasks); NotifyOfPropertyChange(() => Users); } IsBusy = false; await OffineSyncTaskService.Execute(this, () => { DispatcherHelper.OnUi(async() => await LoadTasksFromDb()); }); //if (CheckInternetConnection(false)) //{ // AddOperation(); // Task.Factory.StartNew(async () => // { // Debug.WriteLine("sync" + Dispatcher.CheckAccess()); // await (new LoadDataService(false).SyncTasks()).ContinueWith(async response => // { // var result = await response; // RemoveOperation(); // if (result) // { // DispatcherHelper.OnUi(() => LoadTasksFromDb()); // } // }); // }); //} await LoadWorkspaces(isUserAction); await LoadUsers(isUserAction); if (NavigationEventArgs.NavigationMode != NavigationMode.Back || isUserAction) { LoadMyTasks(isUserAction); } }
protected override async void OnLoad() { if (NavigationEventArgs.IsBackOrReset()) { await LoadOnBack(); return; } Sync(); }
protected override async void OnLoad() { IsBusy = true; await LoadTasksFromDb(); IsBusy = false; if (NavigationEventArgs.IsBackOrReset()) { NotifyAll(); return; } LoadTasks(); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { Container.Resolve <IMessagePublisher>().Register(this); ExNavigationService.ClearNavigationHistory(); if (NavigationEventArgs.IsBackOrReset()) { NotifyOfPropertyChange(() => Workspaces); NotifyOfPropertyChange(() => DueTodayTasks); NotifyOfPropertyChange(() => MyTasks); NotifyOfPropertyChange(() => Users); NotifyOfPropertyChange(() => DueTomorrowTasks); NotifyOfPropertyChange(() => DueWeekendTasks); } RatingNotificationService.Run(new ApplicationSettingsService(), "Rate our application, we'd like to know what you think about Winsana!", 1, 7, "Winsana", "ok", "cancel"); }
public async void LoadData(bool isUserAction = false) { IsBusy = true; User = await new StorageService().Find <AsanaUser>(UserId); await LoadTasksFromDb(); IsBusy = false; if (NavigationEventArgs.IsBackOrReset()) { NotifyAll(); return; } if (CheckInternetConnection(false)) { AddOperation(); var tasks = new List <System.Threading.Tasks.Task>(); foreach (var w in User.GetAvailableWorkspaces()) { tasks.Add(LoadTasks(w, isUserAction)); } System.Threading.Tasks.Task.Factory.ContinueWhenAll(tasks.ToArray(), x => { User.TasksCount = ActiveTasks.Count; if (IsPinned) { PinService.CreateUpdateStartTileAsync(User.name, User.TasksCountText, PinService.GetUserDetailsUri(UserId), false); } RemoveOperation(); }); } await OffineSyncTaskService.Execute(this, () => { }); }
public async void LoadData(bool isUserAction = false) { IsBusy = true; await LoadTasksFromDb(); IsBusy = false; if (NavigationEventArgs.IsBackOrReset()) { NotifyAll(); return; } await DownloadTasks(isUserAction); await OffineSyncTaskService.Execute(this, () => { }); }
async Task LoadData(bool isUserAction = false) { IsBusy = true; await LoadProjectsFromDb(); await LoadTagsFromDb(); IsBusy = false; if (NavigationEventArgs.IsBackOrReset()) { NotifyOfPropertyChange(() => Tags); NotifyOfPropertyChange(() => Projects); return; } await LoadProjects(isUserAction); await LoadTags(isUserAction); await OffineSyncTaskService.Execute(this, () => { }); }