Skip to content

Instantly share code, notes, and snippets.

@killnine
Created November 5, 2014 15:39
Show Gist options
  • Save killnine/f1671d600265782a24f7 to your computer and use it in GitHub Desktop.
Save killnine/f1671d600265782a24f7 to your computer and use it in GitHub Desktop.
Multiple dialogs...
/* Creates first dialog */
Messenger.Default.Send(new DialogMessageAction<MessageDialogResult>("The current Task has not met its target Net. Are you sure you wish to continue and underrun the Task?", "Underrun Warning", userSelection =>
{
if (userSelection == MessageDialogResult.Affirmative) /* Complete Task */
{
/* Within the callback of the first dialog, the second is created */
Messenger.Default.Send(new DialogMessageAction<string>("Please explain reason for underrun (Required)", "Underrun Comment", comment =>
{
if (string.IsNullOrEmpty(comment))
{
/* A third dialog pops up if user does not fill out form properly */
DispatcherHelper.CheckBeginInvokeOnUI(() => Messenger.Default.Send(new NotificationMessage("You must enter an underrun comment, aborting Task completion."), DialogMessageToken.ErrorDialog));
return;
}
OpenTaskCompleteProgressDialog(false, comment);
}), DialogMessageToken.InputDialog);
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment