async void ProcessRemoveJobWatched(EmployerJobDetail vals) { if (vals != null) { ApiServiceIndividual api = new ApiServiceIndividual(); await api.DeleteWatchListJobasync(vals.JobPostId); WatchListJobsSource.Remove(vals); await _dialog.DisplayAlertAsync("WatchList", "Removed from watchlist", "Ok"); } }
public async void OnNavigatedTo(NavigationParameters parameters) { // check param mode to refresh the lists we have in jobs // JOBWATCHREMOVE / JOBWATCHADD / JOBAPPLY var data = parameters.Where(x => x.Key == "JOBWATCHREMOVE").FirstOrDefault(); if (data.Value != null) { var postid = data.Value.ToString(); var item = WatchListJobsSource.Where(x => x.JobPostId == postid).FirstOrDefault(); if (item != null) { WatchListJobsSource.Remove(item); } } // add watch data = parameters.Where(x => x.Key == "JOBWATCHADD").FirstOrDefault(); if (data.Value != null) { var postid = data.Value.ToString(); ApiServiceIndividual api = new ApiServiceIndividual(); var item = await api.GetWatchedJobsSingleAsync(postid); if (item != null) { WatchListJobsSource.Add(item); } } // apply job list data = parameters.Where(x => x.Key == "JOBAPPLY").FirstOrDefault(); if (data.Value != null) { // trigger apply job here... } }