private async Task errorDialog() { var dialog = new WarningDialog(); dialog.Text = "An Error Occurred: Please ensure that your camera is enabled"; dialog.SecondaryButtonText = ""; await dialog.ShowAsync(); }
//Shows dialog private async void validationDialog(String message) { var dialog = new WarningDialog(); dialog.Title = "Warning"; dialog.Text = message; dialog.SecondaryButtonText = ""; var result = await dialog.ShowAsync(); }
private async void noFramesDialog() { var dialog = new WarningDialog(); dialog.Title = "Warning"; dialog.Text = "No results, please try other filters. Right tap the filter button to reset it to its original state"; dialog.SecondaryButtonText = ""; dialog.PrimaryButtonText = "OK"; await dialog.ShowAsync(); }
//Shows dialog if user tries to leave results page, explaining that all frame picker details will be lost private async Task <bool> disclaimerDialog() { var dialog = new WarningDialog(); dialog.Title = "Warning"; dialog.Text = "If you navigate away from your personalized results they will not be saved, and you sure you want to do this?"; var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary) { return(true); } else { return(false); } }
//dialog that asks user if they want to skip entering a prescription private async Task <bool> validationDialog() { var dialog = new WarningDialog(); dialog.Title = "Warning"; dialog.Text = "You have not entered a valid prescription, are you sure you want to continue?"; var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary) { return(true); } else { return(false); } }
//Shows dialog used for when user tries to navigate away from page private async Task <bool> showWarningDialog() { var dialog = new WarningDialog(); dialog.Title = "Warning"; dialog.Text = "If you leave Virtual Try On, your images will be lost and you will have to retake them. Are you sure you want to do this?"; var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary) { return(true); } else { return(false); } }
//Sets manager and then sets current frames protected async override void OnNavigatedTo(NavigationEventArgs e) { manager = (AppManager)e.Parameter; List <Frame> frames = manager.generateFrameList(true); this.frames.Clear(); foreach (Frame frame in frames) { this.frames.Add(frame); } if (frames.Count == 0) { var dialog = new WarningDialog(); dialog.Title = "Warning"; dialog.Text = "You have 0 results from the frame picker. Do you want to try the frame picker again? If you select no you will navigate back to the Frame Browser"; dialog.PrimaryButtonText = "Yes"; dialog.SecondaryButtonText = "No"; ContentDialogResult result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary) { manager.destroyPatient(); manager.setMode(Mode.FrameSelector); manager.navigateMain(typeof(AboutYouPage)); } else { manager.destroyPatient(); manager.setMode(Mode.Browse); manager.navigateMain(typeof(NavPage)); } } else { //This is never really used for this app. //But the idea might be, with the consent of the patient //To store the patient class isntance created allong with the result frames //And use the data to perfect the frame picker. manager.setPatientFrames(frames); } }