How should one handle validation in WPF 4 when there is no binding? Most of the validation doco I am reading seems to be for controls that have bindings.
For example, just a main windows with some text boxes that a user would fill out, and then a button someone would then click on. One could do it manually I guess but wouldn’t’ there be a WPF approach for this?
(any short code examples would be appreciated)
I think the most WPF solution would be to create a ViewModel you could bind to, then doing the validation there For example if its a change of password form with an additional “confirm password” field, this won’t bind directly to a “user” model with just one password field. So instead create a viewModel with 2 fields “password1” and “password2”, databind to these two properties and add representation-specific validation here.