|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
namespace LocalizationSync
{
public class DestinationValidationRule : ValidationRule
{
public string ErrorMessage { get; set; }
public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
{
ValidationResult lResult = null;
IEnumerable<object> lCollection = (IEnumerable<object>)value;
if (lCollection == null || lCollection.Count() == 0)
lResult = new ValidationResult(false, ErrorMessage);
else
lResult = new ValidationResult(true, null);
return lResult;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been a software developer for a while and still find this an interesting job.