title: Problem setting property value on Custom Control Template Part
body: <p>I have a custom control template that contains a Slider control.<br>
  I name that as a part in the class that implements the custom control:  </p>
  
  <pre><code>[TemplatePart(Name = MapZoomSliderName, Type = typeof(Slider))]
  </code></pre>
  
  <p>In the OnApplyTemplate() override, I get the Slider:  </p>
  
  <pre><code>        MapZoomSlider = (Slider) GetTemplateChild("MapZoomSlider");
          if (null != MapZoomSlider)
          {
  
              MapZoomSlider.ValueChanged +=new RoutedPropertyChangedEventHandler&lt;double&gt;(MapZoomSlider_ValueChanged);
              MapZoomSlider.Value = InitSliderValue;  // crash
              _lastSliderValue = MapZoomSlider.Value;
          }
  </code></pre>
  
  <p>When I try to set the Slider's Value property, the app crashes with "Object reference not set to an instance of an object."<br>
  Getting the slider's value works as expected.<br>
  What do I need to do to set the Slider's value at run time?<br>
  Thanks for any tips...</p>