Hi,
Is there any way to set an e mail mask to the XamMaskedEditor? And a web Site?
Thanks in advance.
Antxon
Hello Antxon,
I was looking into your post and in order to achieve this functionality I can suggest you handle the LostFocus event of the XamNumericEditor and check if the entered value match the email regex pattern like this:
private void XamNumericEditor_LostFocus(object sender, RoutedEventArgs e)
{
string strIn=(sender as XamMaskedEditor).Value.ToString();
(sender as XamMaskedEditor).IsValueValid= Regex.IsMatch(strIn,
@"^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))" +
@"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$");
}
You can find this possible approach to set an email regex in the following link from msdn with detailed description of the sintaxis:
http://msdn.microsoft.com/en-us/library/01escwtf(v=vs.95).aspx
Please notice that by setting the property IsVlueValid to false the editor itself will show a red border to indicate the incorrect value.
If you need any additional assistance on the matter, please do not hesitate to ask.
I was just wondering did you have a chance to try my suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
In case the above suggestion helped you solve your issue please verify the thread as answered, so other users may take better advantage of it.