Summary
Binds the overall validation of a ViewModel to a specified View property.
Syntax
[SuppressMessage("Design", "CA1801: Parameter unused", Justification = "Used for generic resolution")]
public static IDisposable BindValidation<TView, TViewModel, TViewProperty>(this TView view, TViewModel viewModel, Expression<Func<TView, TViewProperty>> viewProperty, IValidationTextFormatter<string> formatter = null)
where TView : IViewFor<TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel
Attributes
Type |
Description |
SuppressMessageAttribute |
|
Type Parameters
Name |
Description |
TView |
IViewFor of TViewModel. |
TViewModel |
ViewModel type. |
TViewProperty |
View property type. |
Parameters
Name |
Type |
Description |
view |
TView |
IViewFor instance. |
viewModel |
TViewModel |
ViewModel instance. Can be null, used for generic type resolution. |
viewProperty |
Expression<Func<TView, TViewProperty>> |
View property to bind the validation message. |
formatter |
IValidationTextFormatter<string> |
Validation formatter. Defaults to SingleLineFormatter . In order to override the global
default value, implement IValidationTextFormatter<TOut> and register an instance of
IValidationTextFormatter<string> into Splat.Locator.
|
Return Value
Type |
Description |
IDisposable |
Returns a IDisposable object. |