Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ValidationWithValidateMethodsViewModel"/> class.
        /// </summary>
        /// <param name="person">The person.</param>
        /// <param name="deferValidationUntilFirstSave">if set to <c>true</c> [defer validation until first save].</param>
        public ValidationWithValidateMethodsViewModel(ModelWithoutValidation person = null, bool deferValidationUntilFirstSave = true)
        {
            if (person == null)
            {
                person = new ModelWithoutValidation();
            }

            Person = person;
            DeferValidationUntilFirstSaveCall = deferValidationUntilFirstSave;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ValidationWithValidateMethodsViewModel"/> class.
        /// </summary>
        /// <param name="person">The person.</param>
        /// <param name="deferValidationUntilFirstSave">if set to <c>true</c> [defer validation until first save].</param>
        public ValidationWithValidateMethodsViewModel(ModelWithoutValidation person = null, bool deferValidationUntilFirstSave = true)
        {
            if (person == null)
            {
                person = new ModelWithoutValidation();
            }

            Person = person;
            DeferValidationUntilFirstSaveCall = deferValidationUntilFirstSave;
        }
        public ValidationWithDataAnnotationsViewModel(ModelWithoutValidation person = null, bool deferValidationUntilFirstSave = true)
        {
            if (person == null)
            {
                person = new ModelWithoutValidation();
            }

            Person = person;
            DeferValidationUntilFirstSaveCall = deferValidationUntilFirstSave;

            Title = "Validation with data annotations";
        }
Example #4
0
        public ValidationInIValidatorViewModel(ModelWithoutValidation person = null, bool deferValidationUntilFirstSave = true)
        {
            if (person == null)
            {
                person = new ModelWithoutValidation();
            }

            Person = person;
            DeferValidationUntilFirstSaveCall = deferValidationUntilFirstSave;

            Title = "Validation in IValidator";
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ValidationInIValidatorViewModel" /> class.
        /// </summary>
        /// <param name="messageService">The message service.</param>
        /// <param name="person">The person.</param>
        /// <param name="deferValidationUntilFirstSave">if set to <c>true</c> [defer validation until first save].</param>
        public ValidationWithFluentValidationViewModel(ModelWithoutValidation person, bool deferValidationUntilFirstSave, IMessageService messageService)
        {
            Argument.IsNotNull(() => messageService);

            _messageService = messageService;

            if (person == null)
            {
                person = new ModelWithoutValidation();
            }

            Person = person;
            DeferValidationUntilFirstSaveCall = deferValidationUntilFirstSave;
            CheckCommand = CommandHelper.CreateCommand(CheckCommandExecute, () => PersonValidationSummary);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ValidationInIValidatorViewModel" /> class.
        /// </summary>
        /// <param name="messageService">The message service.</param>
        /// <param name="person">The person.</param>
        /// <param name="deferValidationUntilFirstSave">if set to <c>true</c> [defer validation until first save].</param>
        public ValidationWithFluentValidationViewModel(ModelWithoutValidation person, bool deferValidationUntilFirstSave, IMessageService messageService)
        {
            Argument.IsNotNull(() => messageService);

            _messageService = messageService;

            if (person == null)
            {
                person = new ModelWithoutValidation();
            }

            Person = person;
            DeferValidationUntilFirstSaveCall = deferValidationUntilFirstSave;
            CheckCommand = CommandHelper.CreateCommand(CheckCommandExecute, () => PersonValidationSummary);
        }