示例#1
0
 private void TextBoxEmail_LostFocus(object sender, RoutedEventArgs e)
 {
     if (TextBoxEmail.Text == "")
     {
         return;
     }
     if (!ValidatorExprensions.IsValidEmail(TextBoxEmail.Text))
     {
         TextBoxEmail.Text       += "(Error!)";
         TextBoxEmail.BorderBrush = Brushes.Red;
         TextBoxEmail.Foreground  = Brushes.Red;
     }
 }
示例#2
0
 private void TextBoxEmail_GotFocus(object sender, RoutedEventArgs e)
 {
     if (TextBoxEmail.Text == "")
     {
         return;
     }
     TextBoxEmail.BorderBrush = Brushes.Black;
     TextBoxEmail.Foreground  = Brushes.Black;
     if (!ValidatorExprensions.IsValidEmail(TextBoxEmail.Text))
     {
         TextBoxEmail.Text = "";
     }
     if (TextBoxEmail.Text.Contains("(Error!)"))
     {
         TextBoxEmail.Text = TextBoxEmail.Text.Replace("(Error!)", "");
     }
 }