c# - Is there a way to propagate input validation in model through viewmodel -
i have model few properties , in model validation checks (checking if values don't exceed ranges, if number, if valid postal code etc). these checks should done model, think.
i have choice of using 1 of these validation interfaces: inotifydataerrorinfo
or idataerrorinfo
. not have preference.
i have viewmodel exposes many of model's properties along couple of additional, view-specific , housekeeping properties such isselected, isinscope, issaved etc.
the view (in case dxgrid devexpress) bound collection of viewmodels, hiding model's validation checks (it bound viewmodel's interface). there easy way propagate model's validation checks view, , through viewmodel?
edit: fyi, i'm using simple mvvm toolkit, has incorporated inotifydataerrorinfo in model base class, not in viewmodel base class.
Comments
Post a Comment