14 lines
450 B
C#
14 lines
450 B
C#
using System.Globalization;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Hermes.Validation {
|
|
class MandatoryString : ValidationRule {
|
|
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
|
if(string.IsNullOrWhiteSpace((string) value)) {
|
|
return new ValidationResult(false, "Ce champ est obligatoire");
|
|
}
|
|
return ValidationResult.ValidResult;
|
|
}
|
|
}
|
|
}
|