Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Explain user what is happening
//explain the issue
MessageDialog requestPermissionDialog =
new MessageDialog($"The app needs to access the {library}. " +
"Press OK to open system settings and give this app permission. " +
"If the app closes, reopen it afterwards. " +
"If you Cancel, the app will have limited functionality only.");
//setup dialog commands
var okCommand = new UICommand("OK");
requestPermissionDialog.Commands.Add(okCommand);
var cancelCommand = new UICommand("Cancel");
requestPermissionDialog.Commands.Add(cancelCommand);
requestPermissionDialog.DefaultCommandIndex = 0;
requestPermissionDialog.CancelCommandIndex = 1;
//display to user
var requestPermissionResult = await requestPermissionDialog.ShowAsync();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment