Polyline.Points Свойство

Определение

Получает или задает коллекцию, содержащую точки вершин Polyline.

public:
 property System::Windows::Media::PointCollection ^ Points { System::Windows::Media::PointCollection ^ get(); void set(System::Windows::Media::PointCollection ^ value); };
public System.Windows.Media.PointCollection Points { get; set; }
member this.Points : System.Windows.Media.PointCollection with get, set
Public Property Points As PointCollection

Значение свойства

Коллекция структур Point, описывающих точки вершин Polyline. Значением по умолчанию является пустая ссылка (Nothing в Visual Basic).

Примеры

В следующем примере показано, как создать Polyline элемент и задать Points свойство с помощью кода.


// Add the Polyline Element
myPolyline = gcnew Polyline();
myPolyline->Stroke = Brushes::SlateGray;
myPolyline->StrokeThickness = 2;
myPolyline->FillRule = FillRule::EvenOdd;
Point Point4 = Point(1, 50);
Point Point5 = Point(10, 80);
Point Point6 = Point(20, 40);
PointCollection^ myPointCollection2 = gcnew PointCollection();
myPointCollection2->Add(Point4);
myPointCollection2->Add(Point5);
myPointCollection2->Add(Point6);
myPolyline->Points = myPointCollection2;
myGrid->Children->Add(myPolyline);

// Add the Polyline Element
myPolyline = new Polyline();
myPolyline.Stroke = System.Windows.Media.Brushes.SlateGray;
myPolyline.StrokeThickness = 2;
myPolyline.FillRule = FillRule.EvenOdd;
System.Windows.Point Point4 = new System.Windows.Point(1, 50);
System.Windows.Point Point5 = new System.Windows.Point(10, 80);
System.Windows.Point Point6 = new System.Windows.Point(20, 40);
PointCollection myPointCollection2 = new PointCollection();
myPointCollection2.Add(Point4);
myPointCollection2.Add(Point5);
myPointCollection2.Add(Point6);
myPolyline.Points = myPointCollection2;
myGrid.Children.Add(myPolyline);

' Add a Polyline Element
Dim myPolyline As New Polyline()
myPolyline.Stroke = Brushes.SlateGray
myPolyline.StrokeThickness = 2
myPolyline.FillRule = FillRule.EvenOdd
Dim Point4 As New System.Windows.Point(1, 50)
Dim Point5 As New System.Windows.Point(10, 80)
Dim Point6 As New System.Windows.Point(20, 40)
Dim myPointCollection2 As New PointCollection()
myPointCollection2.Add(Point4)
myPointCollection2.Add(Point5)
myPointCollection2.Add(Point6)
myPolyline.Points = myPointCollection2
myGrid.Children.Add(myPolyline)

Комментарии

Чтобы задать этот атрибут, используйте разделенный пробелами список пар координат X и Y с разделителями-запятыми. Используйте простую нотацию, то есть x1,y1 x2,y2 ... xn,yn.

Сведения о свойстве зависимостей

Поле идентификатора PointsProperty
Для свойств метаданных задано значение true AffectsRender, AffectsMeasure

Применяется к

См. также раздел