title: Binding a RichTextBox to a Slider Control in C#
body: <p>I have the following XAML code that I want to perform in xaml.cs.</p>
  
  <pre><code>&lt;RichTextBox.LayoutTransform&gt;
      &lt;ScaleTransform ScaleX="{Binding ElementName=mySlider, Path=Value}"
                      ScaleY="{Binding ElementName=mySlider, Path=Value}"/&gt;
  &lt;/RichTextBox.LayoutTransform&gt;
  </code></pre>
  
  <p>Basically it binds the slider to the richtextbox and performs zooming.</p>
  
  <p>The following is what i have attempted:</p>
  
  <pre><code>RichTextBox newtext = new RichTextBox();
  ScaleTransform mytran = new ScaleTransform();
  mytran.ScaleX = mySlider.Value;
  mytran.ScaleY = mySlider.Value;
  newtext.LayoutTransform = mytran;
  </code></pre>