Search code examples
c#silverlightcustom-controlsbindingsourcechildwindow

Childwindow + Custom Textbox binding problems


Greetings everyone,

I'm having a very strange problem. I've created a DateTextBox which automaticly adds the dashes when typing a Date or when you typ something like 1-1-1986 it automaticly makes it 01-01-1986 (while typing).

In this control I validate the date and then update the binding source using

this.GetBindingExpression(TextBox.TextProperty).UpdateSource();

this works properly in any form but when I start using it in a childwindow it does get to the this.GetBindingExpression(TextBox.TextProperty).UpdateSource();

but it doesn't update the source. Any breakpoint at the "set" will be ignored.

Even when element binding it to a datepicker it still doesn't update when I typ in a valid date.

Any ideas how I can fix this?

[edit 1] Forgot to add that this control and stuff is in silverlight. But I assume people would have guessed that [/edit]


Solution

  • Fixed this with several extra properties.