Class ObservableValidationBase<TViewModel, TValue>
- Namespace
- ReactiveUI.Validation.Components
- Assembly
- ReactiveUI.Validation.dll
ReactiveObject is the base object for ViewModel classes, and it implements INotifyPropertyChanged. In addition, ReactiveObject provides Changing and Changed Observables to monitor object changes.
public abstract class ObservableValidationBase<TViewModel, TValue> : ReactiveObject, IReactiveNotifyPropertyChanged<IReactiveObject>, IHandleObservableErrors, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, IEnableLogger, IDisposable, IPropertyValidationComponent, IValidationComponent, IValidatesProperties
Type Parameters
TViewModelTValue
- Inheritance
-
ObservableValidationBase<TViewModel, TValue>
- Implements
-
IEnable
Logger
- Derived
- Inherited Members
- Extension Methods
Constructors
ObservableValidationBase(IObservable<IValidationState>)
Initializes a new instance of the ObservableValidationBase<TViewModel, TValue> class.
Parameters
observableIObservable<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
viewModelTViewModel ViewModel instance.
observableIObservable<TValue>Observable that updates the view model property validity.
isValidFuncFunc<TViewModel, TValue, bool>Func to define if the viewModelProperty is valid or not.
messageFuncFunc<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
propertyExpression<Func<TViewModel, TProp>>ViewModel property.
Type Parameters
TPropAny type.
ContainsPropertyName(string, bool)
Determine if a property name is actually contained within this.
Parameters
propertyNamestringViewModel property name.
exclusivelyboolIndicates 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.