Thank you for all your help.
The problem I am having with the code you sent me is that if a wrong value is entered in the TextBox (DiceTol.Text) a red arrow appears beside the entered value and, as you stated, the property DiceThreshold is not updated with the wrong value. The wrong value keeps being displayed in the TextBox because the code has no way to know whether the value entered is right or wrong.
When the button "Load Matched Structures" is clicked, the content of the property DiceThreshold is used to sift out the names displayed in the rightmost column. The code uses the Dice coefficient to automatically rename the strings in the 4th column according to the gold standard string in the leftmost column. The Dice Coefficient returns an estimate of the guess goodness between 0 and 1. By entering a value between 0 and 1 in the TextBox (DiceTol.Text) the user decides to discard all the guessed strings that scored a value below the entered threshold.
When the code has to decide which strings to display in the rightmost column, it needs to know the content of DiceThreshold. You are telling me DiceThreshold is updated if and only if the entered value is between 0 and 1 so I can use it safely (I will check that).
However, when the entered value is not accepted then it has to be reset to its default value when the button "Load Matched Structures" is clicked.
How can the code that handles the clicking event know when to use the content of DiceThreshol and when to use the default value?
If I define a boolean variable inside the namespace but outside the Mainwindow class then will your data validation procedure be able to set it to True when a right value is entered and to False when a wrong value is entered? Will that boolean variable be accessible by the code inside MainWindow class?