pglazkov / MvvmValidation

Lightweight library that helps reduce boilerplate when implementing validation in XAML MVVM applications
MIT License
167 stars 31 forks source link

Examples for nested/complex property? #31

Open GF-Huang opened 3 years ago

GF-Huang commented 3 years ago
public class ComplexModel {
    public int Number { get; set; }
    public string Name { get; set; }
    public bool IsOK { get; set; }
}

public class ViewModel : ValidatableViewModelBase {
    public ComplexModel Model { get; set; }

    public ViewModel() {
        Validator.AddRule(...) // how to validate Model.Number == 1 && Model.Name == "xxx" && Model.IsOK ?
    }
}