blob: dd5b9f3bda80106847899922f191ee19630e5ec3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
using System;
using System.Globalization;
using System.Windows.Controls;
namespace MaterialDesignDemo.Domain
{
public class IsCheckedValidationRule : ValidationRule
{
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
if( value is bool && (bool) value)
{
return ValidationResult.ValidResult;
}
return new ValidationResult(false, "Option must be checked");
}
}
}
|