public object Convert(object[] values, Type targetType, object parameter,
                              System.Globalization.CultureInfo culture)
        {
            double value   = (double)values[0];
            double minimum = (double)values[1];
            double maximum = (double)values[2];

            return(RadialSliderHelper.GetAngle(value, maximum, minimum));
        }
 private void Ellipse_MouseMove(object sender, MouseEventArgs e)
 {
     if (_isPressed)
     {
         //Find the parent canvas.
         if (_templateCanvas == null)
         {
             _templateCanvas = RadialSliderHelper.FindParent <Canvas>(e.Source as Ellipse);
             if (_templateCanvas == null)
             {
                 return;
             }
         }
         //Canculate the current rotation angle and set the value.
         const double RADIUS = 150;
         Point        newPos = e.GetPosition(_templateCanvas);
         double       angle  = RadialSliderHelper.GetAngleR(newPos, RADIUS);
         knob.Value = (knob.Maximum - knob.Minimum) * angle / (2 * Math.PI);
     }
 }