/// <summary> /// Loads async all houses from the API and updates the stored houses /// </summary> public async Task LoadDataAsync(MasterDetailsViewState viewState) { SampleItems.Clear(); var houses = await GameOfThronesDataService.GetAllHousesAsync(); SubstitueEmptyAttributes(houses); if (viewState == MasterDetailsViewState.Both) { if (SampleItems != null) { Selected = SampleItems.First(); } } }
/// <summary> /// Loads async the books given the list from the API with limit /// and updates the stored books /// </summary> /// <param name="urls">list of URL of books</param> public async Task LoadDataAsyncWithURLs(MasterDetailsViewState viewState, string[] urls = null) { if (urls != null) { var books = await GameOfThronesDataService.GetBookByUrlAsync(urls, limit); SampleItems.Clear(); SubstitueEmptyAttributes(books); } if (viewState == MasterDetailsViewState.Both) { if (SampleItems != null) { Selected = SampleItems.First(); } } }