async void Handle_Appearing(object sender, System.EventArgs e) { await PullData(); if (!loadingData) { if (PokeData.AllCaught()) { catchButton.IsEnabled = true; releaseButton.IsEnabled = false; } else if (PokeData.AllMissing()) { releaseButton.IsEnabled = true; catchButton.IsEnabled = false; } else { catchButton.IsEnabled = true; releaseButton.IsEnabled = true; } } }
async Task SetAllCaughtStatus(bool caught) { string caughtString = caught.ToString().ToUpper(); var changeSelected = await DisplayAlert("Are you sure?", youAreAbout + caughtString + noUndo, "Change", "Cancel"); if (changeSelected) { loading.IsRunning = true; await App.CaughtDatabaseInstance.PopulateDatabase(caught, true); loading.IsRunning = false; await DisplayAlert("Changed!", statusSet + caughtString, "Okay"); checkAllCaught = PokeData.AllCaught(); checkAllMissing = PokeData.AllMissing(); } }
void Handle_Appearing(object sender, System.EventArgs e) { if (PokeData.AllCaught()) { catchButton.IsEnabled = false; releaseButton.Text = "Release 'em All"; catchButton.Text = "You got 'em all!"; } else if (PokeData.AllMissing()) { releaseButton.IsEnabled = false; catchButton.Text = "Catch 'em All"; releaseButton.Text = "Better catch 'em all!"; } else { catchButton.IsEnabled = true; releaseButton.IsEnabled = true; releaseButton.Text = "Release 'em All"; catchButton.Text = "Catch 'em All"; } }