TextBox Text Property Binding Problem


If I bind TextBox's Text property to a data model, I can enter text in the text box and via the magic of binding have the value appear in the data model after I exit the text box. This is the standard behavior described on MSDN, and it works just fine.

The problem comes when I have text in the TextBox and try to use backspace to clear it. Once it is cleared, if I change the focus to a different control, the empty string left in the TextBox is not sent to the data model.

It is as though a property changed event is not fired when the TextBox's text is changed from any string to an empty string.

Is this a bug or a feature? Is there a workaround?

[727 byte] By [CodeGorilla] at [2008-1-5]
# 1
Normally this won't happen... Can you post some code?
Yi-LunLuo-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified