title: Modern UI for WPF - ModernDialog: Allow to click Ok only on some conditions
body: <p>I started a new small project, using ModernUI for WPF.</p>
  
  <p>I've to display a Dialog with only two textbox and two button(ok/cancel).</p>
  
  <p>The two textbox have some validation(one is a name that should be >0, the other should be an email).</p>
  
  <p>Currently I've the following:</p>
  
  <pre><code>        var userEditionForm = new UserEditionForm(oneUserConfigurationViewModel);
          var dlg = new ModernDialog
          {
              Title = "User edition",
              Content = userEditionForm,
              Width = 300
          };
          dlg.Buttons = new[] {dlg.OkButton, dlg.CancelButton};
          dlg.ShowDialog();
          return dlg.DialogResult.HasValue &amp;&amp; dlg.DialogResult.Value;
  </code></pre>
  
  <p>The content user control is:</p>
  
  <pre><code>&lt;UserControl x:Class="Test.UserControls.UserEditionForm"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               mc:Ignorable="d"
               d:DesignHeight="300" d:DesignWidth="300"&gt;
      &lt;Grid&gt;
          &lt;StackPanel Orientation="Vertical"&gt;
              &lt;StackPanel.Resources&gt;
                  &lt;Style TargetType="StackPanel"&gt;
                      &lt;Setter Property="Orientation" Value="Horizontal" /&gt;
                      &lt;Setter Property="Margin" Value="0,0,0,4" /&gt;
                  &lt;/Style&gt;
                  &lt;Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}"&gt;
                      &lt;Setter Property="Width" Value="100" /&gt;
                      &lt;Setter Property="VerticalAlignment" Value="Center" /&gt;
                  &lt;/Style&gt;
              &lt;/StackPanel.Resources&gt;
  
              &lt;StackPanel&gt;
                  &lt;Label Content="Name" Target="{Binding ElementName=TextFirstName}" /&gt;
                  &lt;TextBox x:Name="TextFirstName" Width="150"
                           Text="{Binding User.Name, RelativeSource={RelativeSource AncestorType=UserControl}, Mode=TwoWay, ValidatesOnDataErrors=True}" /&gt;
              &lt;/StackPanel&gt;
              &lt;StackPanel&gt;
                  &lt;Label Content="Email" Target="{Binding ElementName=TextEmail}" /&gt;
                  &lt;TextBox x:Name="TextEmail" Width="150"
                           Text="{Binding User.Email, RelativeSource={RelativeSource AncestorType=UserControl}, Mode=TwoWay, ValidatesOnDataErrors=True}" /&gt;
              &lt;/StackPanel&gt;
          &lt;/StackPanel&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>The validation is made, but I would like to prevent the user to click "OK" until the validation is good. Is it possible? If yes, how?</p>