终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
1.0 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Documents;
  8. using System.Windows.Media;
  9. namespace BeDesignerSCADA.Adorners
  10. {
  11. public class SelectionAlignLine : Adorner
  12. {
  13. public SelectionAlignLine(UIElement adornedElement, Point start, Point end) : base(adornedElement)
  14. {
  15. startPoint = start;
  16. endPoint = end;
  17. }
  18. Point startPoint = default(Point);
  19. Point endPoint = default(Point);
  20. protected override void OnRender(DrawingContext drawingContext)
  21. {
  22. base.OnRender(drawingContext);
  23. Rect adornerRect = new Rect(AdornedElement.DesiredSize);
  24. Pen render = new Pen(new SolidColorBrush(Colors.RoyalBlue), 1);
  25. render.DashCap = PenLineCap.Round;
  26. render.DashStyle = new DashStyle(new List<double>() { 4, 2 }, 2);
  27. drawingContext.DrawLine(render, startPoint, endPoint);
  28. }
  29. }
  30. }