public MainPage() { InitializeComponent(); var client = new AppHttpClient(); Task.Factory.StartNew(new Action(() => { var fetchMatchesTask = client.GetMatchesAsync(); fetchMatchesTask.Wait(); matches = JsonMatchDeserializer.GetMatchObservableCollectionFromJsonString(fetchMatchesTask.Result); PopulateMatchItemsControl(matches); })); }
public async Task<MatchData> GetMatchDataAsync() { if (MatchData != null) return MatchData; var client = new AppHttpClient(); var dataString = await client.GetMatchDataAsync(GetMatchId()); MatchData = JsonMatchDeserializer.GetMatchDataFromJsonString(dataString); return MatchData; }