title: WPF - How to display the cutom exception from view insted of viewmodel
body: <p>I have a WPF MMVM application and we are getting xml parser exception from viewmodel method. But the problem is I don't want to show the exception from viewmodel. I would like to show the message from view (<code>CustomMessageBox.Show()</code> call from view)</p>
  
  <p>As per the below code, I am calling <code>CustomMessageBox.Show()</code> from view model catch block.
  How can I call <code>CustomMessageBox.Show()</code> from <code>xaml.cs</code> or <code>xaml</code>?</p>
  
  <p>How can we notify the view about this and call <code>CustomMessageBox.Showfrom</code> view?. This code snippet is called in a WPF command.</p>
  
  <p>Current implementation:</p>
  
  <pre><code>try
  {
    var xamlReader = XamlReader.Parse(xamlText);
    var gb = modelTemplate.GetGraphicalObject("Icons");
    var strings = new Dictionary&lt;string, string&gt; { { "Default", xamlText } };
    gb.UpdateGraphicalObject(strings, null, null);
    if (xamlReader != null)
    {
      var view = new Viewbox();
      view.Child = (UIElement)xamlReader;
      view.Stretch = Stretch.Uniform;
      modelVM.Icon = view;
      }
    }
    catch (XamlParseException)
    {
      CustomMessageBox.Show("Invalid XAML file specified.", Properties.Resources.NextGenSim, MessageBoxButton.OK, MessageBoxImage.Error);
      //throw new XamlParseException("Invalid XAML file specified");
    }
  </code></pre>