Problem in resetting control after validation

Jun 15, 2009 at 11:20 PM

Hi All,

I am applying the validation in Silver light 3.0 beta application where i am performing DML operation and I m facing the following problem:

If  I enter some value in textbox and click the SAVE button then the value inside the control is save in the database and textbox is clear. Then the validate message always appearing on  the textbox  until and unless I enter text in textbox. I need to reset the state of the textbox.

The code is -

 

<TextBox x:Name="TxtContactFirstName" Text="{Binding FieldName, Mode=TwoWay, ValidatesOnExceptions=True}"

 

 

 In the validation.cs  code is -

private string fieldName;

 

public string FieldName

 

get { return fieldName; }

 

set

{

 

if ((value == null) || (value.Trim().Length==0 ))

 

throw new Exception(Resources.Labels.Validate_Empty);

 

value;

 

}

}

}

fieldName =

{

 

 

{