Polyline.Points Proprietà

Definizione

Ottiene o imposta una raccolta che contiene i punti vertice di Polyline.Gets or sets a collection that contains the vertex points of the 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

Valore della proprietà

PointCollection

Raccolta di strutture Point che descrivono i punti vertice di Polyline.A collection of Point structures that describe the vertex points of the Polyline. Il valore predefinito è un riferimento null (Nothing in Visual Basic).The default is a null reference (Nothing in Visual Basic).

Esempio

Nell'esempio seguente viene illustrato come creare un Polyline elemento e impostare la Points proprietà utilizzando il codice.The following example shows how to create a Polyline element and set the Points property by using code.


// 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)

Commenti

In Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML) usare un elenco delimitato da spazi di coppie di coordinate x e y separate da virgole per impostare questo attributo.In Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML), use a space-delimited list of comma-separated x- coordinate and y-coordinate pairs to set this attribute. Usare la notazione semplice, ovvero x1,y1 x2,y2 ... xn,yn .Use simple notation, that is, x1,y1 x2,y2 ... xn,yn.

Informazioni proprietà di dipendenzaDependency Property Information

Campo identificatoreIdentifier field PointsProperty
Proprietà dei metadati impostate su trueMetadata properties set to true AffectsRender, AffectsMeasureAffectsRender, AffectsMeasure

Si applica a

Vedi anche