Created
November 5, 2014 15:39
-
-
Save killnine/f1671d600265782a24f7 to your computer and use it in GitHub Desktop.
Multiple dialogs...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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