private async Task GetSearchResultsAsync() { PlanetsideService pService = new PlanetsideService(QueryServiceId); CharacterQueryResult cqr = await pService.GetMultipleCharacters(charSearch.Text.ToLower()); PopulateListView(cqr); //PopulateListViewWithImages(temp); }
public async Task <CharacterQueryResult> GetMultipleCharacters(string lowQuery) { string json; using (var client = new WebClient()) { //string url = $"https://census.daybreakgames.com/s:{ServiceId}/get/ps2:v2/character/?name.first_lower=^{lowQuery}&c:limit=50&c:sort=name.first_lower"; string url = $"https://census.daybreakgames.com/s:trashpanda/get/ps2:v2/character/?name.first_lower=^{lowQuery}&c:limit=50&c:sort=name.first_lower"; json = await client.DownloadStringTaskAsync(url); } CharacterQueryResult resultClass = Newtonsoft.Json.JsonConvert.DeserializeObject <CharacterQueryResult>(json); return(resultClass); }
/** * Method to go through each item and set the ImageSource property accoridng to FactionId * maybe disable the results from being visible until this method is complete? */ private void PopulateListView(CharacterQueryResult cqr) { resultListView.ItemsSource = cqr.Characters; }