protected override void RenderBorder(DrawingContext drawingContext)
        {
            RadialIndicator radialIndicator = (RadialIndicator)Target;

            drawingContext.DrawGeometry(Brushes.Transparent, new Pen(radialIndicator.BorderBrush, radialIndicator.BorderThickness),
                                        GetControlShape());
        }
        protected override Geometry GetControlShape()
        {
            RadialIndicator radialIndicator = (RadialIndicator)Target;

            double w = radialIndicator.ActualWidth, h = radialIndicator.ActualHeight,
                   cx = w / 2, cy = h / 2,
                   rx = w / 2, ry = h / 2;

            EllipseGeometry eg0 = new EllipseGeometry(new Point(cx, cy), rx, ry);
            EllipseGeometry eg1 = new EllipseGeometry(new Point(cx, cy),
                                                      rx - radialIndicator.RingThickness, ry - radialIndicator.RingThickness);

            return(new CombinedGeometry(GeometryCombineMode.Exclude, eg0, eg1));
        }
        protected override void RenderContent(DrawingContext drawingContext)
        {
            RadialIndicator radialIndicator = (RadialIndicator)Target;

            double w = radialIndicator.ActualWidth, h = radialIndicator.ActualHeight,
                   cx = w / 2, cy = h / 2,
                   rx = w / 2, ry = h / 2,
                   val = radialIndicator.GetPercentage() / 100;

            Geometry ring = GetControlShape(),
                     pie  = getIndicatorPie(cx, cy, rx, ry, 90,
                                            (radialIndicator.Direction == IndicatorDirection.Backward ? val : -val * 360.0));

            drawingContext.DrawGeometry(radialIndicator.Foreground, new Pen(),
                                        new CombinedGeometry(GeometryCombineMode.Intersect, ring, pie));
        }
 public RadialIndicatorRenderer(RadialIndicator target) : base(target)
 {
 }
        protected override void RenderBackground(DrawingContext drawingContext)
        {
            RadialIndicator radialIndicator = (RadialIndicator)Target;

            drawingContext.DrawGeometry(radialIndicator.Background, new Pen(), GetControlShape());
        }