I was porting a modal dialog to a non-modal one.
My problem is: uiCompletedEventArgs.Result
is null.
I've seen having the debug exception enabled that the following exception is thrown "DialogResult can be set only after Window is created and shown as dialog."
Here is a snippet of my code
var viewmodel = viewModelFactory.CreateViewModel<GenericViewModel>(someIds);
uiVisualizerService.Show(viewmodel, CompletedProc);
}
private async void CompletedProc(object sender, UICompletedEventArgs uiCompletedEventArgs)
{
if (uiCompletedEventArgs.Result.HasValue && uiCompletedEventArgs.Result.Value) //here's null
{ ... }
How can I tell if a user clicked Yes
or Cancel
button?
Thanks for your advice.