aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TEMP/Tango.Graphics2D/VisualBinders/LineBinder.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/TEMP/Tango.Graphics2D/VisualBinders/LineBinder.cs')
-rw-r--r--Software/Visual_Studio/TEMP/Tango.Graphics2D/VisualBinders/LineBinder.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/Software/Visual_Studio/TEMP/Tango.Graphics2D/VisualBinders/LineBinder.cs b/Software/Visual_Studio/TEMP/Tango.Graphics2D/VisualBinders/LineBinder.cs
new file mode 100644
index 000000000..6c6a6f0b8
--- /dev/null
+++ b/Software/Visual_Studio/TEMP/Tango.Graphics2D/VisualBinders/LineBinder.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media;
+using System.Windows.Shapes;
+
+namespace Tango.Graphics2D.VisualBinders
+{
+ public class LineBinder : IVisualBinder
+ {
+ public void DrawVisual(FrameworkElement element, Drawing2DHost host, DrawingContext context)
+ {
+ Line line = element as Line;
+
+ var location = host.GetElementLocation(line);
+ var size = host.GetElementSize(line);
+
+ Pen pen = null;
+
+ if (line.Stroke != null)
+ {
+ pen = new Pen(line.Stroke, line.StrokeThickness);
+ pen.DashCap = line.StrokeDashCap;
+ //TODO: add some stroke features...
+ }
+
+ context.DrawLine(pen, new Point(line.X1, line.Y1), new Point(line.X2, line.Y2));
+ }
+
+ public List<DependencyProperty> GetRenderProperties()
+ {
+ return new List<DependencyProperty>()
+ {
+ Line.OpacityProperty,
+ Line.VisibilityProperty,
+ Line.StrokeProperty,
+ Line.X1Property,
+ Line.Y1Property,
+ Line.X2Property,
+ Line.Y2Property,
+ Line.StrokeThicknessProperty
+ };
+ }
+ }
+}