title: DataValidation in WPF using ValidatesOnExceptions
body: <p>I want to run a basic data validation sample in WPF using <code>ValidatesOnException</code>, but its simply not working, and as soon as my <code>viewmodel</code> throws <code>ValidationException</code>, my program crashes saying, <strong>ValidationException was unhandled by user code</strong>.</p>
  
  <p>My View Model is</p>
  
  <pre><code>public class MainViewModel : INotifyPropertyChanged
  {
      //INotifyPropertyChaned implementation
      //////////////////////////////////////
      private string stringValue;
  
      public string StringValue
      {
          get { return stringValue; }
          set
          {
              if (value.Length &gt; 6)
              {
                  //The below line throws unhandled exception error??
                  throw new ValidationException(String.Format("Value's length is greater than {0}.", value.Length));
              }
              stringValue = value;
              this.OnPropertyChanged("StringValue");
          }
      }
  }
  </code></pre>
  
  <p><strong>My XAML is</strong></p>
  
  <pre><code>&lt;StackPanel x:Name="LayoutRoot" Background="White"&gt;
  &lt;TextBox x:Name="radMaskedTextInput1" 
                                  Width="200"
                                  Margin="10"
                                  Text="{Binding Path=StringValue, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}" /&gt;
  &lt;/StackPanel&gt;
  </code></pre>