private async void DownloadQuestionsButton_Tap(object sender, System.Windows.Input.GestureEventArgs e) { if (DeviceOpStatus.IsInternetConnected() == true) { progressIndicator = new ProgressIndicator(); progressIndicator.IsVisible = true; progressIndicator.Text = "Λήψη Ερωτήσεων. Παρακαλώ περιμένετε..."; progressIndicator.IsIndeterminate = true; SystemTray.SetProgressIndicator(this, progressIndicator); try { if (await QuestionsService.UpdateQuestions() == true) { MessageBox.Show("Επιτυχής λήψη νέων ερωτήσεων"); QuestionsCountText.Text = "Σύνολο ερωτήσεων " + QuestionsService.CountQuestions().ToString(); } else { MessageBox.Show("Δεν βρέθηκαν νέες ερωτήσεις"); } } catch (Exception exp) { MessageBox.Show("Σφάλμα κατα τον συγχρονισμό. Παρακαλώ δοκιμάστε αργότερα"); } progressIndicator.IsVisible = false; progressIndicator.IsIndeterminate = false; } else { MessageBox.Show("Δεν βρέθηκε σύνδεση στο ίντερνετ. Παρακαλώ δοκιμάστε αργότερα"); } }
public GamePage() { InitializeComponent(); var bannerAd = Monetize.SetAdBanner(AdFormats.Banner, "ca-app-pub-5683686090349772/5803920646"); AdRequest adRequest = new AdRequest(); adRequest.Gender = UserGender.Male; adRequest.ForceTesting = true; // Enable test ads AdPanel.Children.Add(bannerAd); bannerAd.LoadAd(adRequest); if (DeviceOpStatus.IsInternetConnected()) { OfflineAd.Visibility = Visibility.Collapsed; } if (App.QuestionsList.Any()) { _questionstimer = new DispatcherTimer(); GetSavedGame(); GetQuestionsByDifficultyLevel(); GetNextQuestion(); PlaySoundEffect("whistle"); } else { MessageBox.Show("Πρόβλημα κατα την λήψη & προβολή των ερωτήσεων. Παρακαλούμε πραγματοποιήστε εκ νέου συγχρονισμό νέων ερωτήσεων"); NavigationService.Navigate(new Uri("/SettingsPage.xaml", UriKind.Relative)); } }