public async Task LoadData(bool append, ProfileSearchType type) { if (type == ProfileSearchType.notype) { type = _currentType; } _currentType = type; if (append) { PageNumber++; } else { PageNumber = 1; } InCall = true; try { if (Questions == null || !append) { Questions = new ObservableCollection <HNQuestion>(); } QuestionsResult = await DataService.ProfileSearch(PageNumber, CurrentUser.user_attributes.id, type.ToString()); foreach (var q in QuestionsResult.questions) { Questions.Add(q); } } catch (Exception ex) { if (ex is HttpRequestException) { await new MessageDialog("We're having trouble connecting to the HiNative servers").ShowAsync(); } } InCall = false; }
private void SearchProfile(ProfileSearchType type) { App.ViewModelLocator.ProfileSearch.CurrentUser = User; App.ViewModelLocator.ProfileSearch.LoadData(false, type); _navigationService.NavigateTo(typeof(ProfileSearchPage)); }