Polyline.cs 730 B

1234567891011121314151617181920212223242526272829
  1. using Avalonia;
  2. using Avalonia.Controls;
  3. using Avalonia.Controls.Shapes;
  4. using Avalonia.Media;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace InABox.Avalonia.Components.ImageEditing;
  11. internal class PolylineObject : IImageEditorObject
  12. {
  13. public List<Point> Points { get; set; } = new List<Point>();
  14. public double Thickness { get; set; } = 1.0;
  15. public IBrush? PrimaryBrush { get; set; }
  16. private Polyline Control = new();
  17. public Control GetControl() => Control;
  18. public void Update()
  19. {
  20. Control.Points = Points.ToList();
  21. Control.Stroke = PrimaryBrush;
  22. Control.StrokeThickness = Thickness;
  23. }
  24. }