1

私はSilverlightで動的にアークセグメントを作成しました。そして、slider1が移動するときに、虹のように上下に10と言う多くのアークを作成するために、forループを呼び出しました。次に、別のslider2値の変更で、この10個の円弧すべてのサイズを大きくしたいと思います。しかし、私の問題は、新しい関数でこれらのアークセグメントにアクセスするには(サイズを大きくするため)、アークセグメントオブジェクトをグローバルに宣言する必要があることです。しかし、それが好きな場合は、slider1changeの新しい値で1つのアークしか生成されません。この問題を解決する方法???...

私のコード-

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;

            segmentCollection.Add(arc);
            pathFigure.Segments = segmentCollection;
            figureCollection.Add(pathFigure);
            pathGeometry.Figures = figureCollection;

            displayPath.Data = pathGeometry;
            LayoutRoot.Children.Add(displayPath);
        }
4

0 に答える 0