blob: 1723d560eee807b3a9eb1f31d3b9b1342fd1c5e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using System;
using System.Globalization;
using System.Windows.Controls;
namespace Gestor.Common.Validation
{
public class ValidacaoTelefone : ValidationRule
{
public ValidacaoTelefone()
{
}
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
object obj = value;
if (obj == null)
{
obj = "";
}
if (string.IsNullOrWhiteSpace(obj.ToString()) || value.ToString().ValidatePhone())
{
return ValidationResult.ValidResult;
}
return new ValidationResult(false, "Telefone Inválido");
}
}
}
|