mvvm - Is there a way of have simple validation in the controls in Silverlight -


i'm coming delphi programing world, i'm starting learn silverlight, entity framework, ria services, mvvm , stuff.

i want know if there kind of technic, controls, approach, pattern or else allows simple validations or verifications live in client when user typing. in delphi world controls (db-aware ones) have ability of doing that, know type of data showing, can configure max length, in general know information data floating point type not allow more 1 point in , on.

i understand different , have validations in business classes, services, models, domain , depends using, , in database.

any thoughts suggestion can this?

excuse me english not main language.

validation in silverlight tied closely binding, , commonly done in 1 of 2 major ways:

  • client-side validation using dataannotation-generated validators in property setters
  • server-side validation done when entity committed store

client-side validators depend on exceptions thrown in setter when validation fails. server-side validation returns notifications when validator fails. 2 binidng options validatesonexceptions (client-side) , notifyonvalidationerror (server-side.)

it sounds you're wanting "real-time" validation type. practical application formatting validation, such email addresses or social security numbers. typically done regular expression validators.

the short story no, there nothing "out of box" type of validation, can done. validation applied @ property level using dataannotations:

http://msdn.microsoft.com/en-us/library/dd901590(v=vs.95).aspx

you can use regularexpressionattribute validate text property against regular expression. however, under normal conditions value validated after update, meaning when tab away control being validated. can use updatesourcetrigger=explicit binding option validate type:

http://msdn.microsoft.com/en-us/library/system.windows.data.binding.updatesourcetrigger(v=vs.95).aspx

here overview of data validation in silverlight:

http://www.devproconnections.com/article/silverlight-development/silverlight-data-validation.aspx


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -