Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Created January 31, 2019 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinZikmund/988de298f4955fb3a2ffeaec987548c4 to your computer and use it in GitHub Desktop.
Save MartinZikmund/988de298f4955fb3a2ffeaec987548c4 to your computer and use it in GitHub Desktop.
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