title: C# - connecting Slider to TextBox and read in TextBox value
body: <p>I have in my MainPage() the following line of code:</p>
  
  <pre><code>string str = tbx1.Text;
  </code></pre>
  
  <p>Then I have a slider that changes this TextBox:</p>
  
  <pre><code>    private void Slider_ValueChanged_1(object sender, RoutedPropertyChangedEventArgs&lt;double&gt; e)
      {
          Slider slider1 = sender as Slider;
          tbx1.Text = slider1.Value.ToString();
  
      }
  </code></pre>
  
  <p>When I run the app the default value of <code>tbx1</code> is read in, and it can be changed with the slider. But how do I read in the new value of <code>tbx1</code> into <code>str</code>? It seems that only the default value is kept in <code>str</code>.</p>