You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
550 B

using System.Globalization;
using System.Windows.Controls;
namespace ex_ValidationWithValidationRule
{
/// <summary>
/// Règle de validation d'un int
/// </summary>
public class IntValidationRule : ValidationRule
{
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
if (value == null)
{
return new ValidationResult(false, "Please enter a valid Int");
}
return new ValidationResult(true,null);
}
}
}