Paste this code your Common.Cs
------------------------------------------
public static bool isEmail(string inputEmail)
{
if (inputEmail != "")
{
string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
@"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
@".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";
Regex re = new Regex(strRegex);
if (re.IsMatch(inputEmail))
return (true);
else
return (false);
}
return (true);
}
and in Codebehind;
if (Common.isEmail(txtbx_Email.Text))
{
}
else
{
MessageBox.Show("Email not valid!", "Save", MessageBoxButton.OK, MessageBoxImage.Warning);
txtbx_Email.Focus();
return false;
}