Navigation :
Introduction
FAQ
Setup, deployment & projects
Getting started
Examples
Catel.Core
Catel.MVVM
Catel.Fody
Catel.ReSharper
Tips & tricks
API reference
-
Catel.Cores
--
Catel
---
Catel.Android
---
Catel.ApiCop
---
Catel.Caching
---
Catel.Collections
---
Catel.ComponentModel
---
Catel.Configuration
---
Catel.Core
---
Catel.Data
---- AdvancedPropertyChangedEventArgs
---- AttributeValidatorProvider
---- BoxingCache
---- BusinessRuleValidationResult
---- CatelTypeInfo
---- ChangeNotificationWrapper
---- ChildAwareModelBase
---- ComparableModelBase
---- CompositeValidator
---- CompositeValidatorProvider
---- DispatcherObservableObject
---- EditableObjectHelper
---- EventChangeType
---- ExcludeFromValidationAttribute
---- FieldValidationResult
---- IAdvancedNotifyPropertyChanged
---- IBusinessRuleValidationResult
---- IFieldValidationResult
---- IModel
---- IModelEditor
---- IModelEqualityComparer
---- IModelExtensions
---- IModelSerialization
---- ISavableModel
---- ISavableModelExtensions
---- IValidatable
---- IValidatableExtensions
---- IValidatableModel
---- IValidatableModelExtensions
---- IValidationContext
---- IValidationContextExtensions
---- IValidationResult
---- IValidationSummary
---- IValidator
---- IValidatorProvider
---- IValueValidator
---- InvalidPropertyException
---- InvalidPropertyValueException
---- ModelBase
---- ModelBaseExtensions
---- ModelEqualityComparer
---- ObservableObject
---- ObservableObjectExtensions
---- PropertyAlreadyRegisteredException
---- PropertyBag
---- PropertyData
---- PropertyDataManager
---- PropertyNotNullableException
---- PropertyNotRegisteredException
---- PropertyValue
---- SavableModelBase
---- SuspensionContext
---- ValidatableModelBase
---- ValidateModelAttribute
---- ValidationContext
---- ValidationContextChange
---- ValidationContextChangeType
---- ValidationContextHelper
---- ValidationEventArgs
---- ValidationExtensions
---- ValidationResult
---- ValidationResultType
---- ValidationSummary
---- ValidatorBase
---- ValidatorProviderBase
---- XmlNameMapper
---
Catel.ExceptionHandling
---
Catel.IO
---
Catel.IoC
---
Catel.Linq
---
Catel.Logging
---
Catel.Messaging
---
Catel.Pooling
---
Catel.Reflection
---
Catel.Runtime
---
Catel.Scoping
---
Catel.Services
---
Catel.Test
---
Catel.Text
---
Catel.Threading
--- Argument
--- AsyncEventHandler
--- AsyncEventHandlerExtensions
--- ByteArrayExtensions
--- CatelEnvironment
--- CompositeFilter
--- CompositePredicate
--- CoreModule
--- DesignTimeCodeAttribute
--- DesignTimeHelper
--- DesignTimeInitializer
--- Disposable
--- DisposableToken
--- Enum
--- EnvironmentHelper
--- EventHandlerExtensions
--- ExceptionExtensions
--- ExceptionFactory
--- ExpressionHelper
--- FastDateTime
--- HashHelper
--- IBindableEnum
--- ICommandManagerExtensions
--- ICompositeFilter
--- IDisposableToken
--- IExecute
--- IExecuteWithObject
--- IFluent
--- INotifyPropertyChangedExtensions
--- IUniqueIdentifyable
--- IWeakAction
--- IWeakEventListener
--- IWeakFunc
--- IWeakReference
--- JsonExtensions
--- KnownPlatforms
--- LanguageHelper
--- MVVMModule
--- MustBeImplementedException
--- NotSupportedInPlatformException
--- ObjectHelper
--- ObjectToStringHelper
--- OpenInstanceActionHandler
--- OpenInstanceEventHandler
--- ParallelHelper
--- Platforms
--- ProcessExtensions
--- ProgressContext
--- ResourceHelper
--- SerializationJsonModule
--- StringExtensions
--- StringToObjectHelper
--- SupportedPlatforms
--- TagHelper
--- ThemeHelper
--- ThreadHelper
--- UniqueIdentifierHelper
--- UriExtensions
--- WeakAction
--- WeakActionBase
--- WeakEventListener
--- WeakFunc
--
Systems
-
Catel.MVVMs
-
Catel.Serialization.Jsons
IValidator
Name
Value
Assembly
Catel.Core
Namespace
Catel.Data
Available on
.NET Framework 4.5, .NET Framework 4.6, Portable Class Libraries, Xamarin - Android, Xamarin - iOS
public interface IValidator
Validator that can handle the validation of an object.
Methods
AfterValidateBusinessRules(object instance, List<IBusinessRuleValidationResult> validationResults)
Called just after the specified instance has validated its business rules.
Parameters
Name
Description
instance
The instance that has just been validated.
validationResults
The validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
AfterValidateFields(object instance, List<IFieldValidationResult> validationResults)
Called just after the specified instance has validated its fields.
Parameters
Name
Description
instance
The instance that has just been validated.
validationResults
The validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
AfterValidation(object instance, List<IFieldValidationResult> fieldValidationResults, List<IBusinessRuleValidationResult> businessRuleValidationResults)
Called just after all validation has been executed.
Parameters
Name
Description
instance
The instance that has just been validated.
fieldValidationResults
The current field validation results.
businessRuleValidationResults
The current business rule validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
BeforeValidateBusinessRules(object instance, List<IBusinessRuleValidationResult> previousValidationResults)
Called just before the specified instance is about to be validate its business rules.
Parameters
Name
Description
instance
The instance that is about to be validated.
previousValidationResults
The validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
BeforeValidateFields(object instance, List<IFieldValidationResult> previousValidationResults)
Called just before the specified instance is about to be validate its fields.
Parameters
Name
Description
instance
The instance that is about to be validated.
previousValidationResults
The previous validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
BeforeValidation(object instance, List<IFieldValidationResult> previousFieldValidationResults, List<IBusinessRuleValidationResult> previousBusinessRuleValidationResults)
Called just before any validation is caused.
Parameters
Name
Description
instance
The instance that is about to be validated.
previousFieldValidationResults
The previous field validation results.
previousBusinessRuleValidationResults
The previous business rule validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
Validate(object instance, ValidationContext validationContext)
Validates the specified instance and allows the manipulation of the whole validation context. This method can be used to manipulate the whole validation context and the implementation of this is enough.
Parameters
Name
Description
instance
The instance to validate.
validationContext
The validation context.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
ValidateBusinessRules(object instance, List<IBusinessRuleValidationResult> validationResults)
Validates the business rules of the specified instance. The results must be added to the list of validation results.
Parameters
Name
Description
instance
The instance to validate.
validationResults
The validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
ValidateFields(object instance, List<IFieldValidationResult> validationResults)
Validates the fields of the specified instance. The results must be added to the list of validation results.
Parameters
Name
Description
instance
The instance to validate.
validationResults
The validation results.
Exceptions
Name
Description
ArgumentNullException
The instance isnull
.
Have a question about Catel? Use StackOverflow with the Catel tag!
Discussion
Please enable JavaScript to view the comments powered by Disqus.