Class ObservableValidationBase<TViewModel, TValue>
- Namespace
- ReactiveUI.Validation.Components
- Assembly
- ReactiveUI.Validation.dll
A validation component that is based on an IObservable<T>.
public abstract class ObservableValidationBase<TViewModel, TValue> : ReactiveObject, IDisposable, IPropertyValidationComponent, IValidationComponent, IValidatesProperties
Type Parameters
TViewModel
TValue
- Inheritance
-
ObservableValidationBase<TViewModel, TValue>
- Implements
- Derived
- Extension Methods
Constructors
ObservableValidationBase(IObservable<IValidationState>)
Initializes a new instance of the ObservableValidationBase<TViewModel, TValue> class.
Parameters
observable
IObservable<IValidationState >Observable that updates the view model property validity.
ObservableValidationBase(TViewModel, IObservable<TValue>, Func<TViewModel, TValue, bool>, Func<TViewModel, TValue, bool, IValidationText>)
Initializes a new instance of the ObservableValidationBase<TViewModel, TValue> class.
protected ObservableValidationBase(TViewModel viewModel, IObservable<TValue> observable, Func<TViewModel, TValue, bool> isValidFunc, Func<TViewModel, TValue, bool, IValidationText> messageFunc)
Parameters
viewModel
TViewModel ViewModel instance.
observable
IObservable<TValue>Observable that updates the view model property validity.
isValidFunc
Func<TViewModel, TValue, bool>Func to define if the viewModelProperty is valid or not.
messageFunc
Func<TViewModel, TValue, bool, IValidationText >Func to define the validation error message.
Properties
IsValid
Gets a value indicating whether the validation is currently valid or not.
Property Value
Properties
Gets the properties associated with this validation component.
Property Value
PropertyCount
Gets the total number of properties referenced.
Property Value
Text
Gets the current (optional) validation message.
Property Value
ValidationStatusChange
Gets the observable for validation state changes.
Property Value
Methods
AddProperty<TProp>(Expression<Func<TViewModel, TProp>>)
Adds a property to the list of this which this validation is associated with.
Parameters
property
Expression<Func<TViewModel, TProp>>ViewModel property.
Type Parameters
TProp
Any type.
ContainsPropertyName(string, bool)
Determine if a property name is actually contained within this.
Parameters
propertyName
stringViewModel property name.
exclusively
boolIndicates if the property to find is unique.
Returns
- bool
Returns true if it contains the property, otherwise false.
Dispose()
Dispose(bool)
Disposes of the managed resources.