Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ok, I've managed to cause the arc to open and close. The way I did this was by defining both of the Arc's lines like this</p> <pre><code>&lt;PathGeometry&gt; &lt;PathFigure StartPoint="50,0" IsClosed="True"&gt; &lt;LineSegment Point="0,100" x:Name="m_leftLine" /&gt; &lt;LineSegment Point="100,100" x:Name="m_rightLine" /&gt; &lt;/PathFigure&gt; &lt;/PathGeometry&gt; </code></pre> <p>And then just writing a code behind for the slider's <code>ValueChanged</code> event and recalculate the line's X position using the required angle. This resulted in the following code:</p> <pre><code>public partial class MyFovControl : UserControl { private float m_oldAngleValue; private float m_newAngleValue; public MyFovControl() { InitializeComponent(); this.zoomSlider.ValueChanged += new RoutedPropertyChangedEventHandler&lt;double&gt;(zoomSlider_ValueChanged); m_oldAngleValue = m_newAngleValue = 0; } void zoomSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs&lt;double&gt; e) { m_newAngleValue = (float)(Convert.ToDouble((double)lblFovXAngle.Content)); // Happens only once the first time. if (m_oldAngleValue == 0) { m_oldAngleValue = m_newAngleValue; } m_leftLine.Point = new Point(m_leftLine.Point.X + (m_oldAngleValue - m_newAngleValue), m_leftLine.Point.Y); m_rightLine.Point = new Point(m_rightLine.Point.X - (m_oldAngleValue - m_newAngleValue), m_rightLine.Point.Y); m_oldAngleValue = m_newAngleValue; } } </code></pre> <p>I know, very messi, but that's the only way I could think of and from what I've searched online - possibly the only way there is.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload