private async Task DisplayItems(string searchString) { if (IsInternet()) { var items = await EntireItemsProcessor.GetPreviews(ApiHelper.ApiClient, searchString.ToLower()); if (items.Count() > 0) { Items = new ObservableCollection <Grouping <string, ItemPreview> >(items); } else { _maxLength = searchString.Length; } } }
private protected abstract object DecryptItem(object obj); //get an object(an item for that particular page) and return the decrypted version //functions private async Task HandleCreate() { //handle creation of item var createStatus = IsModelValid(); if (createStatus.IsError) { await DisplayPopupError(createStatus.Message); return; } await PageService.PopAllAsync(); await PageService.PushPopupAsync(new WaitForActionView(), false); bool isCallSucces = false; try { isCallSucces = await CreateAsync(); } catch (Exception ex) { PageService.HandleException(ex); return; } await PageService.PopPopupAsync(false); if (isCallSucces) { var latestCreatedItem = await EntireItemsProcessor.GetLatestCreated(ApiHelper.ApiClient, ItemType); if (latestCreatedItem is null) { await DisplayPopupError(ErrorMsg.ItemNotCreated(ItemType)); } else { UpdateModel model = new UpdateModel(TypeOfUpdates.Create, latestCreatedItem); await GoTo(ItemType.ToString(), model); } } else { await DisplayPopupError(ErrorMsg.ItemNotCreated(ItemType)); } }
private protected override async Task <IEnumerable <Grouping <string, ItemPreview> > > RefreshPageAsync() { var previews = await EntireItemsProcessor.GetPreviews(ApiHelper.ApiClient); return(previews); }
private protected async override Task GetDataAsync() { IEnumerable <Grouping <string, ItemPreview> > previews = await EntireItemsProcessor.GetPreviews(ApiHelper.ApiClient); DisplayItems(previews); }