title: wpf progress bar bind to a listbox value
body: <p>How can i move a progress bar value( i am simulating a car mph circular gauge using a progress bar) in accordance to a listbox value or combobox value? I am using a rectangle for the needle.</p>
  
  <p>I can do it with a scroll bar( the value of the scrollbar makes the needle move) which is the code i will show. Instead of the value of the scroll bar i want to be able to have various speeds set in a listbox, combobox and when selected the progress bar / rectangle will move to that value.</p>
  
  <p>Can this be done?</p>
  
  <p>i will only show the code i think you need to see..
  here is a pic of what i am talking about:</p>
  
  <p><img src="https://i.stack.imgur.com/qoALe.png" alt="enter image description here"></p>
  
  <pre><code>&lt;Window.Resources&gt;
  &lt;ControlTemplate x:Key="templateSpeedometer"
                       TargetType="ProgressBar"&gt;
      &lt;ControlTemplate.Resources&gt;
          &lt;Style TargetType="Line"&gt;
          &lt;/Style&gt;
      &lt;/ControlTemplate.Resources&gt;
  
  
          &lt;Canvas Width="0" Height="0" 
                      RenderTransform="1 0 0 1 0 50" Background="#FFF50D0D"&gt;
  
              &lt;Rectangle Name="PART_Track" Width="180" /&gt;
              &lt;Rectangle Fill="Black" Name="PART_Indicator" /&gt;
  
  
  
              &lt;Polygon Points="5 2 5 -5 -75 0"
                           Stroke="Black" Fill="Gold"&gt;
                  &lt;Polygon.RenderTransform&gt;
                      &lt;RotateTransform 
                              Angle="{Binding ElementName=PART_Indicator, 
                                              Path=ActualWidth}" /&gt;
                  &lt;/Polygon.RenderTransform&gt;
              &lt;/Polygon&gt;
          &lt;/Canvas&gt;
      &lt;/Border&gt;
  &lt;/ControlTemplate&gt;
  &lt;/Window.Resources&gt;
  
  &lt;Grid x:Name="LayoutRoot"&gt;
  
      &lt;StackPanel&gt;
          &lt;Grid Height="216" Name="grid1" Width="612"&gt;
              &lt;ScrollBar Name="scroll" Orientation="Horizontal" Minimum="0" Maximum="100" SmallChange="1" LargeChange="10" Margin="8,235,4,-36" /&gt;
              &lt;Border Background="#FF5EB6D8"  CornerRadius="25" Height="247" VerticalAlignment="Top" Margin="13,5,27,0"&gt;
  
              &lt;ProgressBar Background="#FFD6E1E5" Margin="4,8,0,112" Maximum="100" Minimum="0" Template="{StaticResource templateSpeedometer}" Value="{Binding ElementName=scroll, Path=Value}" BorderBrush="#FF5EB6D8" OpacityMask="White" HorizontalAlignment="Left" Width="281" BorderThickness="5,1,1,1" Orientation="Vertical"/&gt;
              &lt;/Border&gt;
  </code></pre>