I am looking for a simple solution to the following problem:
I am using a simple TextBox control with a Text attribute bound to a property in the code. In addition, I use a validation rule to notify the user of incorrect entries.
... style display error here ...
Now, after entering the correct data into the TextBox, the user can click the button to send the data. When a button is clicked, data from the associated UserName property in the code behind is evaluated and sent.
The problem is that the user can enter valid data in the TextBox, and this will be set in the UserName property. If the user then decides to change the text in the TextBox and the data becomes invalid, the installer of the UserName property is not called after a failed validation.
This means that the last valid data remains in the UserName property, while the TextBox displays invalid data with an error indicator. If the user then clicks the button to send data, the last valid data will be sent instead of the current contents of the TextBox.
I know that I can deactivate the button if the data is invalid and in fact I do it, but the method is called in the UserName installer. And if this is not called after a failed check, the button remains on.
So the question is: how do I enable the call to the property settings tool after a failed check?
source
share