title: Material Design Template WPF DialogHost wait until close and integration with Prism EventAggregator
body: <p>I am trying to replace the standard WPF <code>MessageBox</code> with a <code>DialogHost</code> from <code>MaterialDesign</code> Library and I do not know how to wait until the user select's OK or Cancel from the Dialog Box.
  The problem I am facing is because I'm calling the display of the dialogue box from a function called using event aggregator.
  Below is my code:</p>
  <pre><code>private async void OnMessageRequest(MessageArgs obj)
  {
     MessageDialogModel = _messageDialogCreator();
     MessageDialogModel.Load(obj.Message, obj.HasButtons);
     var view = new SampleDialog
     {
        DataContext = MessageDialogModel
     };
  
     await DialogHost.Show(view, &quot;RootDialog&quot;);
  
  }
  </code></pre>
  <p>When I was using <code>MessageBox</code> this worked as expected. Here is the code:</p>
  <pre><code>if (obj.HasButtons)
  {
     var result = MessageBox.Show(obj.Message, obj.Title, MessageBoxButton.OKCancel);
     var submitArg = result == MessageBoxResult.OK
        ? MessageDialogResult.OK
        : MessageDialogResult.Cancel;
     _eventAggregator.GetEvent&lt;MessageDialogResultEvent&gt;().Publish(submitArg);
  }
  else
  {
     MessageBox.Show(obj.Message, obj.Title);
  }
  </code></pre>
  <p>Basically what is need is to stop the code after the dialogbox is shown and wait until the user selects and option.
  I hope it makes sense</p>