문제

I have something like this: canvasGraph.Children.Add(new Polyline(){Points = new PointCollection((x1, y1), (x2, y2))}); but it does not work and I don`t know how to deal with it

도움이 되었습니까?

해결책

You are initializing your point collection the wrong way:

canvasGraph.Children.Add(new Polyline(){
  Points = new PointCollection(
    new List<Point> {
      new Point(x1, y1), 
      new Point(x2, y2)})});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top