The following code snippet is a simplified version of my issue. Basically I'm trying to catch the error that occurs in my setter when updatesource is called and propagate it up to my the catch block shown below. The problem is if an exception occurs in the call stack below updatesource, BindingExpression.UpdateSource() seems to catch that error and handle it. I can't get the exception to make it back out to my catch statement. Can this behavior be disabled?
BindingExpression be = textBox.GetBindingExpression(TextBox.TextProperty);
try
{
be.UpdateSource();
}
catch (Exception ex)
{
MessageBox.Show("ex.Message");
}
//////////////////////////////////////////////////////////////////
public string MyValue
{ get {return _value;}
set {
if(value > 10)
throw new Exception("Out of Range");
}
}