title: How do i apply a TranslateTransform on an existing 'Children'
body: <p>I'm rewriting this question to try and make it clearer to people what ive done, trying to do etc.</p>
  
  <p>I am involved in a project where im trying to make some visual displays. One display is a dial, and i pretty much got entire code from this link.</p>
  
  <p><a href="https://github.com/mesta1/WPF-Circular-Gauge/blob/master/CircularGauge/CircularGaugeDemoWPF/CircularGaugeDemoWPF.csproj" rel="nofollow noreferrer">https://github.com/mesta1/WPF-Circular-Gauge/blob/master/CircularGauge/CircularGaugeDemoWPF/CircularGaugeDemoWPF.csproj</a></p>
  
  <p>I am now trying to do a verticle guage, bit like below.
  <img src="https://i.stack.imgur.com/WKtUG.gif" alt="enter image description here"></p>
  
  <p>now ive modified the dial code so background  scale etc all works.</p>
  
  <p>The issue im having is the moving indicator.</p>
  
  <p>The dial code defines the dial in the xaml like the following.</p>
  
  <pre><code>&lt;Path x:Name="Pointer" Stroke="#FFE91C1C" StrokeThickness="2" 
      Width="{TemplateBinding PointerLength}"  
      Height="{TemplateBinding PointerThickness}" 
      HorizontalAlignment="Center" 
      Data="M1,1 L1,10 L156,6 z" Stretch="Fill" 
      RenderTransformOrigin="0,0.5" 
      RenderTransform="{Binding RelativeSource=
      {RelativeSource TemplatedParent}, Path=PointerLength, 
      Converter={StaticResource pointerCenterConverter}}"&gt;
  </code></pre>
  
  <p>and in the .cs file controls its position like the following.</p>
  
  <pre><code>TransformGroup tg = pointer.RenderTransform as TransformGroup;
  RotateTransform rt = tg.Children[0] as RotateTransform;
  rt.Angle = angleValue;
  </code></pre>
  
  <p>now as im only moving the indicator vertically up and down, i believe that i need a TranslateTransform. With the help of Sheridan. Ive changed my xaml to the following.</p>
  
  <pre><code>&lt;Path x:Name="Pointer" Stroke="#FFE91C1C" StrokeThickness="2" 
      VerticalAlignment="Bottom"
      Data="M 0,0 L 16,-5 L16,5 L0,0 z"&gt;
          &lt;Path.RenderTransform&gt;
              &lt;TransformGroup&gt;
                  &lt;TranslateTransform/&gt;
               &lt;/TransformGroup&gt;
           &lt;/Path.RenderTransform&gt;
  </code></pre>
  
  <p>now im struggling with what my .cs needs to be to edit this. Currently im playing with </p>
  
  <pre><code>TransformGroup tg = pointer.RenderTransform as TransformGroup;
  TranslateTransform rt = tg.Children[0] as TranslateTransform;
  rt.Y = -10;
  </code></pre>
  
  <p>this however throws error "Cannot set a property on object 'System.Windows.Media.TranslateTransform' because it is in a read-only state."</p>
  
  <p>i have been advised again by Sheridan to try assigning a new object adn replacing the old. But what i seems to try either throws errors or has no effect.</p>