title: How to set and get updatesourcetrigger of a textbox in codebehind?
body: <p>Just a short question :<br>
  In wpf, how do I set and get updatesourcetrigger of a textbox in codebehind ?<br>
  Thanks</p>
  
  <p><em><strong>Update :</em></strong><br>
  I follow AngleWPF's code :</p>
  
  <pre><code>        var bndExp = BindingOperations.GetBindingExpression(this, TextBox.TextProperty);
  
          var myBinding
            = bndExp.ParentBinding;
  
          var updateSourceTrigger = myBinding.UpdateSourceTrigger;
  </code></pre>
  
  <p>But I got the exception :  </p>
  
  <blockquote>
    <p>An unhandled exception of type
    'System.Reflection.TargetInvocationException' occurred in
    PresentationFramework.dll Additional information: Exception has been
    thrown by the target of an invocation.</p>
  </blockquote>