tags:

views:

52

answers:

1

I've got a TextBox whose Text property is bound to a property on my view model on LostFocus event. I've noticed that when I move out of this TextBox without changing the value that was already in there, the binding does not happen.

I've got a PreviewKeyDown event handler on the TextBox to handle Enter, Up/Down arrow key presses so that I can move the focus onto other fields on my screen appropriately. Before moving the focus onto another field, I'd like to know whether or not this action will trigger the data binding.

Are there any methods/properties that I can call inside this handler before focus is lost on the textbox (e.g. on the TextBox or on the Binding itself) that will let me know whether the binding will be triggered on the Textbox once focus is lost?

A: 

Does your binding implement the following?

UpdateSourceTrigger=LostFocus

Nathan
Yes, I've set up the binding with UpdateSourceTrigger=LostFocus. What I'd like to know is if there is some way of finding out whether or not the binding will occur. e.g. If I'm inside the textbox and I tab out of it without updating the text inside it, can I somehow be notified that the binding will not occur here?
ren