How to increase size of dynamicallly created arcsegments ?

1 posts, 0 answers
  1. Kevin
    Kevin avatar
    1 posts
    Member since:
    Jan 2013

    Posted 16 Jan 2013 Link to this post

    I have created arcsegements dynamically in silverlight.
    And i called it in  for loop to create many arcs say 10 one above the other like rainbow , as the slider1 moves.
    Now i want to increase the size of all this 10 arcs on another slider2 value change.
    But my problem is that to access these arcsegments in my new function (to increase size), arcsegments object should be declared globally.But when i do like that it generates only 1 arc with the new values on the slider1change.
    How to solve this issue???...

    my code--
    private void drawShell()
                // Path
                    double a=slider1.value;
                Path displayPath = new Path();
                displayPath.Stroke = _brush;
                displayPath.StrokeThickness = 7;
                PathGeometry pathGeometry = new PathGeometry();
                PathFigureCollection figureCollection = new PathFigureCollection();
                PathFigure pathFigure = new PathFigure();
                PathSegmentCollection segmentCollection = new PathSegmentCollection();
                ArcSegment arc = new ArcSegment();
                // Start Point
                pathFigure.StartPoint = new Point(0, 66);
                // End point
                arc.Point = new Point(50+a, 150-a);
                arc.Size = new Size(200-a, 125-a);
                arc.RotationAngle = 0;
                arc.SweepDirection = SweepDirection.Counterclockwise;
                arc.IsLargeArc = false;
                pathFigure.Segments = segmentCollection;
                pathGeometry.Figures = figureCollection;
                displayPath.Data = pathGeometry;
Back to Top