private async void ReadStats() { string trophiesResponse = await _service.MakeRequestAsync("Trophies"); string appearancesResponse = await _service.MakeRequestAsync("Appearances"); string goalsResponse = await _service.MakeRequestAsync("Goals"); if (trophiesResponse == string.Empty || appearancesResponse == string.Empty || goalsResponse == string.Empty) { ConfirmContentDialogViewModel dialogViewModel = new ConfirmContentDialogViewModel("Connection Error", "There was an error connecting to the internet, please check your connection and try again"); ContentDialogResult result = await _dialogService.ShowContentDialogAsync(dialogViewModel); } else { trophies = new ObservableCollection <TrophyYear>(_reader.GetAllTrophyYears(XDocument.Parse(trophiesResponse))); appearances = new ObservableCollection <Player>(_reader.GetAllAppearances(XDocument.Parse(appearancesResponse))); goals = new ObservableCollection <Player>(_reader.GetAllGoals(XDocument.Parse(goalsResponse))); } }
private async Task ShowDialog(string title, string text) { var dialogViewModel = new ConfirmContentDialogViewModel(title, text); ContentDialogResult result = await _dialogService.ShowContentDialogAsync(dialogViewModel); }