Class ObservableValidation<TViewModel, TValue>
- Namespace
- ReactiveUI.Validation.Components
- Assembly
- ReactiveUI.Validation.dll
A validation component that is based on an IObservable<T>.
public sealed class ObservableValidation<TViewModel, TValue> : ObservableValidationBase<TViewModel, TValue>, IDisposable, IPropertyValidationComponent, IValidationComponent, IValidatesProperties
Type Parameters
TViewModel
TValue
- Inheritance
-
Observable
Validation <TViewModel, TValue>Base ObservableValidation<TViewModel, TValue>
- Implements
- Inherited Members
- Extension Methods
Constructors
ObservableValidation(IObservable<IValidationState>)
Initializes a new instance of the ObservableValidation<TViewModel, TValue> class.
Parameters
observable
IObservable<IValidationState >Observable that updates the view model property validity.
ObservableValidation(TViewModel, IObservable<TValue>, Func<TViewModel, TValue, bool>, Func<TViewModel, TValue, bool, string>)
Initializes a new instance of the ObservableValidation<TViewModel, TValue> class.
public ObservableValidation(TViewModel viewModel, IObservable<TValue> observable, Func<TViewModel, TValue, bool> isValidFunc, Func<TViewModel, TValue, bool, string> 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, string>Func to define the validation error message.
ObservableValidation(TViewModel, IObservable<TValue>, Func<TViewModel, TValue, bool>, Func<TViewModel, TValue, string>)
Initializes a new instance of the ObservableValidation<TViewModel, TValue> class.
public ObservableValidation(TViewModel viewModel, IObservable<TValue> observable, Func<TViewModel, TValue, bool> isValidFunc, Func<TViewModel, TValue, string> 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, string>Func to define the validation error message.
ObservableValidation(TViewModel, IObservable<TValue>, Func<TViewModel, TValue, bool>, string)
Initializes a new instance of the ObservableValidation<TViewModel, TValue> class.
public ObservableValidation(TViewModel viewModel, IObservable<TValue> observable, Func<TViewModel, TValue, bool> isValidFunc, string message)
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.
message
stringValidation error message as a constant.
ObservableValidation(TViewModel, IObservable<TValue>, Func<TValue, bool>, Func<TValue, string>)
Initializes a new instance of the ObservableValidation<TViewModel, TValue> class.
public ObservableValidation(TViewModel viewModel, IObservable<TValue> observable, Func<TValue, bool> isValidFunc, Func<TValue, string> messageFunc)
Parameters
viewModel
TViewModel ViewModel instance.
observable
IObservable<TValue>Observable that updates the view model property validity.
isValidFunc
Func<TValue, bool>Func to define if the viewModelProperty is valid or not.
messageFunc
Func<TValue, string>Func to define the validation error message.
ObservableValidation(TViewModel, IObservable<TValue>, Func<TValue, bool>, string)
Initializes a new instance of the ObservableValidation<TViewModel, TValue> class.
public ObservableValidation(TViewModel viewModel, IObservable<TValue> observable, Func<TValue, bool> isValidFunc, string message)
Parameters
viewModel
TViewModel ViewModel instance.
observable
IObservable<TValue>Observable that updates the view model property validity.
isValidFunc
Func<TValue, bool>Func to define if the viewModelProperty is valid or not.
message
stringValidation error message as a constant.