I wrote a behavior to change the time the text gets update, it basically
subscribes to the TextChanged event and does the update explicitly.

On Wed, Apr 14, 2010 at 5:38 PM, Stephen Price <step...@perthprojects.com>wrote:

> Thanks guys,
>
> Bit of reading and playing and have got it working by doing exactly that.
> Wasn't sure why setting it to PropertyChanged wasn't working but it looks
> like the only two values (in SL3.0) are Explicit and default. There's only
> one place where I want the value updated (and it hasn't lost focus) so doing
> the UpdateSource is fine and works.
>
> thanks again! :)
>
> cheers,
> Stephen
>  a
>
> On Wed, Apr 14, 2010 at 2:37 PM, Miguel Madero <m...@miguelmadero.com>wrote:
>
>> 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
>>
>>
>
> _______________________________________________
> 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

Reply via email to