c# - How do i force a data Transfer/Validation in a mvvm application? -


i have simple page few text boxes & text blocks. bound object's properties via xaml in standard mvvm way. dismiss page have added application bar "ok" , "cancel" button.

if user enters text in first textbox, , taps ok button on application bar without first changing focus other control on page, value on textbox not transfered binded object's property (e.g. string empty). if user selects other control in page before taping ok button, works fine.

it seems value of textbox transfered bound data ítem, needs loose focus first, , somehow doesnt happen page dismissed application bar.

i recall having similar problem in windows forms applications, there simple call this.validate() before closing form solve it. see no validate() method on windows phone application page.

so how "force" data transfered form when dismiss page?

thanks in advance.

i think you're after set updatesourcetrigger property on binding, setting propertychanged should force binding update anytime textbox text changes

see msdn


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -