private async void SubmitReport_Click(object sender, RoutedEventArgs e) { // hide buttons this.SubmitButton.Visibility = Visibility.Collapsed; this.DeleteButton.Visibility = Visibility.Collapsed; // show progress ring this.processing.IsActive = true; if (await currentReport.UploadToServer()) { await currentReport.discardReport(true); await currentReportFile.DeleteAsync(StorageDeleteOption.PermanentDelete); this.processing.IsActive = false; //submit report Frame.Navigate(typeof(UnsentReportsPage)); } else { this.processing.IsActive = false; MessageDialog didNotSend = new MessageDialog("Error when attempting to send report, please try again later", "Failed to Send"); didNotSend.Commands.Add(new UICommand("OK")); await didNotSend.ShowAsync(); } }