title: Why does this WPF slider throw an exception?
body: <p>Code:</p>
  
  <pre><code>private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs&lt;double&gt; e)
          {
              updateTickCounter(slider1.Value);
          }
  
          private void updateTickCounter(double value)
          {
              tickCounter.Content = value.ToString();
          }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;Slider Height="32" HorizontalAlignment="Right" Margin="0,21,61,0" Name="slider1" VerticalAlignment="Top" Width="200" IsSnapToTickEnabled="True" Orientation="Horizontal" TickFrequency="1" TickPlacement="BottomRight" Value="1" Minimum="1" Maximum="10" ValueChanged="slider1_ValueChanged" /&gt;
  </code></pre>
  
  <p>I'm trying to have a slider that starts at value 1 out of 10. Every time the slider is moved I want a label called 'tickCounter' to change text.</p>
  
  <p>The code above throws an exception when ran -- "Object reference not set to an instance of an object."</p>
  
  <p>However, once I change both the values of "Value" and "Minimum" in XAML it works fine. It's as if I can't make it not start at zero. It's really weird. Any help?</p>