title: Why does Run.Text bind two-way by default?
body: <p>In .NET 4.0, <a href="http://msdn.microsoft.com/en-us/library/system.windows.documents.run.text%28v=VS.100%29.aspx" rel="noreferrer">Run.Text</a> is bindable. So I tried to bind it:</p>
  
  <pre><code>&lt;Run Text="{Binding DisplayText}"/&gt;
  </code></pre>
  
  <p>But when I ran, I got an error: "A TwoWay or OneWayToSource binding cannot work on the read-only property 'DisplayText' of type 'SomeNamespace.SomeClass'."</p>
  
  <p>My DisplayText property was indeed read-only, but so is a Run -- Runs go in in TextBlocks, which you can't edit. So why would I be getting this error? I dug into PresentationFramework with <a href="http://www.jetbrains.com/decompiler/" rel="noreferrer">dotPeek</a> and sure enough:</p>
  
  <pre><code>public static readonly DependencyProperty TextProperty =
      DependencyProperty.Register("Text", typeof (string), typeof (Run),
      (PropertyMetadata) new FrameworkPropertyMetadata((object) string.Empty,
          FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
          new PropertyChangedCallback(Run.OnTextPropertyChanged),
          new CoerceValueCallback(Run.CoerceText)));
  </code></pre>
  
  <p>The fourth line, plain as day, specifies that Run.Text should bind two-way by default, which makes no sense and seems like a glaring design bug.</p>
  
  <p>Of course, this is easy enough to work around:</p>
  
  <pre><code>&lt;Run Text="{Binding DisplayText, Mode=OneWay}"/&gt;
  </code></pre>
  
  <p>But why should I <em>have</em> to work around it? <strong>Why does Run bind two-way by default?</strong></p>