title: How to distinguish between user input, but allow the application itself to change text
body: <p>I've got a textbox, which does not allow users to enter "[" and "]" characters. However, I would like to set the text to be a value containing both "[" and "]" by default. How can I go about this? This is my code:</p>
  
  <pre><code>TextBox txtEdit = new TextBox();
  txtEdit.TextChanged += txtEdit_TextChanged;
  txtEdit.Text = "[Test]";
  
  private void txtEdit_TextChanged(object sender, TextChangedEventArgs e)
  {
      if ((sender as TextBox).Text.Contains("[") || (sender as TextBox).Text.Contains("]"))
      {
          MessageBox.Show("Cannot enter '[' or ']' characters!", "", MessageBoxButton.OK, MessageBoxImage.Information);
          (sender as TextBox).Text = "";
      }
  }
  </code></pre>