title: User Input Validation Binding
body: <p>hej, </p>
  
  <p>im not sure how to solve my problem. I want to Validate User Input from my TextBox and then Change the color of my Label if the input is Wrong.Do i need 
  to validate the input in my Get and Set? Or is this totaly Wrong?</p>
  
  <p>my xaml code :</p>
  
  <pre><code>&lt;Label x:Name="lblEmail" Content="Email Adress" Foreground="{Binding EmailAdressValid}"/&gt;
  &lt;TextBox x:Name="txtEmail" Text="{Binding EmailAdress, UpdateSourceTrigger=PropertyChanged}"/&gt;
  </code></pre>
  
  <p>My Data Class:</p>
  
  <pre><code>public class MainData : INotifyPropertyChanged {
  
          private int _emailAdress;
          public int EmailAdress
          {
              get { return _emailAdress; }
              set
              {
                  _emailAdress = value;
                  OnPropertyChanged(nameof(EmailAdress));
              }
          }
  
          private System.Windows.Media.Brush _emailAdressValid;
          public System.Windows.Media.Brush EmailAdressValid
          {
              get { return _emailAdressValid; }
              set
              {
                  if(_emailAdress.Contains("@")) {
                     _emailAdressValid = Brushes.Black;
                  }
                  else {
                      _emailAdressValid = Brushes.Red;
                  }
                  OnPropertyChanged(nameof(EmailAdressValid));
              }
          }
  }
  </code></pre>