title: Silverlight TemplateBinding to RotateTransform
body: <p>I am trying to create the simplest Silverlight templated control, and I can't seem to get TemplateBinding to work on the Angle property of a RotateTransform.</p>
  
  <p>Here's the ControlTemplate from generic.xaml:</p>
  
  <pre><code>&lt;ControlTemplate TargetType="local:CtlKnob"&gt;
    &lt;Grid x:Name="grid" RenderTransformOrigin="0.5,0.5"&gt;
      &lt;Grid.RenderTransform&gt;
        &lt;TransformGroup&gt;
           &lt;RotateTransform Angle="{TemplateBinding Angle}"/&gt; &lt;!-- This does not work --&gt;
           &lt;!-- &lt;RotateTransform Angle="70"/&gt; --&gt;             &lt;!-- This works --&gt;
        &lt;/TransformGroup&gt;
      &lt;/Grid.RenderTransform&gt;
      &lt;Ellipse Stroke="#FFB70404" StrokeThickness="19"/&gt;
      &lt;Ellipse Stroke="White" StrokeThickness="2" Height="16" VerticalAlignment="Top"
         HorizontalAlignment="Center" Width="16" Margin="0,2,0,0"/&gt;
    &lt;/Grid&gt;
  &lt;/ControlTemplate&gt;
  </code></pre>
  
  <p>Here's the C#:</p>
  
  <pre><code>using System.Windows;
  using System.Windows.Controls;
  
  namespace CtlKnob
  {
    public class CtlKnob : Control
    {
      public CtlKnob()
      {
        this.DefaultStyleKey = typeof(CtlKnob);
      }
  
      public static readonly DependencyProperty AngleProperty = 
          DependencyProperty.Register("Angle", typeof(double), typeof(CtlKnob), null);
  
      public double Angle
      {
        get { return (double)GetValue(AngleProperty); }
        set { SetValue(AngleProperty,value); }
      }
    }   
  }
  </code></pre>