/**************************************************************************
* File Name:NotEmptyValidationRule.cs
* Description:NotEmptyValidationRule.cs class description...
* Copyright:Copyright © 2020 LeoYang-Chuese. All rights reserved.
* Creator:Leo Yang
* Create Time:2020/12/15
*Project Address:https://github.com/LeoYang-Chuese/wif
**************************************************************************/
using System.Globalization;
using System.Windows.Controls;
namespace Frontier.Wif.Infrastructure.ValidationRules
{
///
/// Defines the
///
public class NotEmptyValidationRule : ValidationRule
{
#region Methods
///
/// The Validate
///
/// The value
/// The cultureInfo
/// The
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
return string.IsNullOrWhiteSpace((value ?? "").ToString())
? new ValidationResult(false, "Field is required.")
: ValidationResult.ValidResult;
}
#endregion
}
}