Пример #1
0
        public static IFluentContinuation <TViewModel, TPropertyValue> Valid <TViewModel, TPropertyValue>(
            this IFluentOperator <TViewModel, TPropertyValue> instance, CustomValidator <TPropertyValue> customValidator)
            where TViewModel : ViewModelBase
        {
            var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance;

            implementerInstance.EnsureContextCurrentPropertyIsNotNull();

            implementerInstance.AddToken(ExpressionNode.CustomValidation(implementerInstance.Context.CurrentProperty, (value, token) => customValidator((TPropertyValue)value, token)));
            return((IFluentContinuation <TViewModel, TPropertyValue>)instance);
        }