async void OnMyMatchHistoryClicked(object sender, EventArgs args) { var matchHistory = await ViewModel.GetMyMatchHistory(); if (matchHistory == null) { await DisplayAlert("Error", "Failed to retrieve match history", "OK"); } else { var matchHistoryView = new MatchHistoryView(matchHistory); matchHistoryView.Title = "My Matches"; await Navigation.PushAsync(matchHistoryView); } }
async void OnSearchClicked(object sender, EventArgs args) { var searchText = searchInput.Text; if (!string.IsNullOrWhiteSpace(searchText)) { var matchHistory = await ViewModel.GetMatchHistory(searchText, regionPicker.Items[regionPicker.SelectedIndex]); if (matchHistory == null) { await DisplayAlert("Error", "Failed to retrieve match history", "OK"); } else { var matchHistoryView = new MatchHistoryView(matchHistory); matchHistoryView.Title = searchInput.Text; await Navigation.PushAsync(matchHistoryView); } } }