The binding is updated on lost focus not on TextChanged, however you can force this doing something like this on your keypress: txt.GetBinding(TextBox.Text).UpdateSource();
On Wed, Apr 14, 2010 at 4:06 PM, Jordan Knight <jordan.kni...@readify.net>wrote: > Maybe have a play with UpdateSourceTrigger and BindingExpression… > > > > > http://msdn.microsoft.com/en-us/library/system.windows.data.binding.updatesourcetrigger(VS.95).aspx > > > > > > > > *From:* ozsilverlight-boun...@ozsilverlight.com [mailto: > ozsilverlight-boun...@ozsilverlight.com] *On Behalf Of *Stephen Price > *Sent:* Wednesday, 14 April 2010 3:57 PM > *To:* ozSilverlight > *Subject:* Closing childwindow > > > > Hey all, > > > > I've hit what seems to be a race condition, I've got a login usercontrol > which uses a ChildWindow. when the user presses enter on the passwordbox I > check if the key == key.enter and if the password is not blank I set the > this.DialogResult = true; which seems to be closing the ChildWindow before > the databinding has updated the underlaying property. Net result is if user > presses enter then the password is null even if they have typed in a > password. > > > > I've tried both keydown and keyup with same outcome. Any suggestions on how > I can get it to close the window after the databinding has done its thing? > Alternatively perhaps invoke the click event on the OK button . Any ideas? > > > > cheers, > > Stephen > > > > > > _______________________________________________ > ozsilverlight mailing list > ozsilverlight@ozsilverlight.com > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight -- Miguel A. Madero Reyes www.miguelmadero.com (blog) m...@miguelmadero.com
_______________________________________________ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight