title: C# System.NullReferenceException during setting slider value to text property
body: <p>I have this simple slider project. I wanna show slider value in TextBox.</p>
  
  <pre><code>&lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"&gt;
       &lt;TextBox x:Name="sliderValue" HorizontalAlignment="Stretch" VerticalAlignment="Top" /&gt;
       &lt;Slider x:Name="slider" Minimum="0" Maximum="20" Value="5" ValueChanged="slider_ValueChanged"/&gt;&lt;/Grid&gt;
  
          // Constructor
      public MainPage()
      {
          InitializeComponent();
      }
  
      private void slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs&lt;double&gt; e)
      {
              var slider = sender as Slider;
              string value = string.Format("{0}", slider.Value);
              sliderValue.Text = value;
      }
  </code></pre>
  
  <p>In last line I am getting this error:</p>
  
  <blockquote>
    <p>System.NullReferenceException: Object reference not set to an instance of an object.
       at slider_test.MainPage.slider_ValueChanged(Object sender, RoutedPropertyChangedEventArgs`1 e)
       at .......</p>
  </blockquote>
  
  <p>Could anyone explain me what is the problem? Thank you.</p>