title: How do I simulate Text input to a WPF TextBox?
body: <p>I want to simulate user input to a WPF TextBox. I want to input a character such that the OnPreviewTextInput event is triggered. I tried setting the Text through the Text property, but this didn't trigger the event: </p>
  
  <pre><code>public void SomeFunction()
  {
      var textBox = new TextBox();
      textBox.Text = "A";                     
  }
  </code></pre>
  
  <p>Can I trigger the event explicitly somehow? </p>