wpf - IDataErrorInfo best practices -


i working in wpf project using mvvm.

what's best practice validate errors using idataerrorinfo? in model or viewmodel?

whats best pattern use implement validation?

p.s. using .net 3.5.

i think there no right way or wrong way. depends on application , whether or not using different patterns or architectures or have specific needs within wpf application.

if using different tiered architecture, put validation within business layer of application. if that's case, use this link.

within applications, put validation within viewmodel. obviously, in cases this bad idea, example; if have firstname property within viewmodel, means limiting gui validate firstname property, if set other place.

it comes down needs of application , requirements. speaking put them within viewmodel, quick , easy. best practices recommend read through link.

i recommend read through following links give better understanding;

how use model validation rules in wpf viewmodel

or

business layer validation sample

hope helps!


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -