C
C#11mo ago
Cam

✅ Avalonia Polyline Method Help

Any idea why this wont work?
c#
public void buildPanel(Canvas NewmarketPanel) // Get Live Session State of Panel and apply to View
{

Polyline X251 = drawToPanel(new List<Avalonia.Point> { new Avalonia.Point(-575, 100), new Avalonia.Point(-560, 100) });
NewmarketPanel.Children.Add(X251);

}
public Polyline drawToPanel(List<Avalonia.Point> points)
{
Polyline newObject = new Polyline
{
Stroke = Avalonia.Media.Brushes.Red,
StrokeThickness = 2
};
var n = points.Count - 1;
for (int i = 0; i < n; i++)
{
newObject.Points.Add(points[i]);
}
//Debug.WriteLine(newObject.ToString());
return newObject;
}
c#
public void buildPanel(Canvas NewmarketPanel) // Get Live Session State of Panel and apply to View
{

Polyline X251 = drawToPanel(new List<Avalonia.Point> { new Avalonia.Point(-575, 100), new Avalonia.Point(-560, 100) });
NewmarketPanel.Children.Add(X251);

}
public Polyline drawToPanel(List<Avalonia.Point> points)
{
Polyline newObject = new Polyline
{
Stroke = Avalonia.Media.Brushes.Red,
StrokeThickness = 2
};
var n = points.Count - 1;
for (int i = 0; i < n; i++)
{
newObject.Points.Add(points[i]);
}
//Debug.WriteLine(newObject.ToString());
return newObject;
}
1 Reply
Cam
CamOP11mo ago
Fixed
Want results from more Discord servers?
Add your server