Silverlight 4 Validation problems

Nov 10, 2010 at 10:34 PM

Hi All,

I am using the IDateErrorInfo interface to provide the user experience when validation fails on a bound property. This all works fine when I am not using a theme! For example, if I have a TextBox that has ValidatesOnDataErrors set "true" and a validation error is detected, the red border and validation tooltip are displayed as expected AND when I move focus away from the TextBox the validation tooltip disappears. Now if I use say the ShinyBlue theme, all is not fine in Kansas! Here is the preconditions: I have a TabControl and several TabItems defined with various TextBox controls on each TabItem. When I force a validation error on the TextBox, all is fine and the validation error element (and associated tooltip) appear just fine. Now for the bad news, when I switch to another TabItem with the error in effect, the validation tooltip DOES NOT DISAPPEAR! When I return to the TabItem with the error and select the TextBox with the error, a SECOND tooltip is posted over the last one. There is no way to recover and the browser refresh option is the only way back to sanity. Now to reiterate, when working without a theme, this problem is not exhibited. I ran into this problem while attempting to add the validation user experience to the DatePicker, which does not have the validation code in the XAML theme code. Another shortcoming is the fact that the CornerRadius value is set to a value of 7 for all themes for items such as the TextBox, which is clearly not appropriate. The correct value for the CornerRadius for the Border named ValidationErrorElement is usually either a value of one or two depending on the theme.

Has anyone seen these issues?