aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs')
-rw-r--r--Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs86
1 files changed, 86 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs b/Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs
new file mode 100644
index 000000000..33f14cd27
--- /dev/null
+++ b/Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs
@@ -0,0 +1,86 @@
+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.EmbroideryUI
+{
+ public class EmbroideryPath : Shape
+ {
+ public PathGeometry Path { get; private set; }
+
+ public Brush Brush
+ {
+ get { return (Brush)GetValue(BrushProperty); }
+ set { SetValue(BrushProperty, value); }
+ }
+ public static readonly DependencyProperty BrushProperty =
+ DependencyProperty.Register("Brush", typeof(Brush), typeof(EmbroideryPath), new PropertyMetadata(null,(d,e) => (d as EmbroideryPath).OnBrushChanged()));
+
+ public double Length
+ {
+ get { return (double)GetValue(LengthProperty); }
+ set { SetValue(LengthProperty, value); }
+ }
+ public static readonly DependencyProperty LengthProperty =
+ DependencyProperty.Register("Length", typeof(double), typeof(EmbroideryPath), new PropertyMetadata(0.0));
+
+ public PathFigure PathFigure
+ {
+ get { return (PathFigure)GetValue(PathFigureProperty); }
+ set { SetValue(PathFigureProperty, value); }
+ }
+ public static readonly DependencyProperty PathFigureProperty =
+ DependencyProperty.Register("PathFigure", typeof(PathFigure), typeof(EmbroideryPath), new PropertyMetadata(null));
+
+ public int StitchCount
+ {
+ get { return (int)GetValue(StitchCountProperty); }
+ set { SetValue(StitchCountProperty, value); }
+ }
+ public static readonly DependencyProperty StitchCountProperty =
+ DependencyProperty.Register("StitchCount", typeof(int), typeof(EmbroideryPath), new PropertyMetadata(0));
+
+ private void OnBrushChanged()
+ {
+ Stroke = Brush;
+ }
+
+ public bool IsSelected
+ {
+ get { return (bool)GetValue(IsSelectedProperty); }
+ set { SetValue(IsSelectedProperty, value); }
+ }
+ public static readonly DependencyProperty IsSelectedProperty =
+ DependencyProperty.Register("IsSelected", typeof(bool), typeof(EmbroideryPath), new PropertyMetadata(false,(d,e) => (d as EmbroideryPath).OnSelectedChanged()));
+
+ private void OnSelectedChanged()
+ {
+ if (IsSelected)
+ {
+ Stroke = Brushes.Black;
+ }
+ else
+ {
+ Stroke = Brush;
+ }
+ }
+
+ public EmbroideryPath(PathGeometry path)
+ {
+ Path = path;
+ }
+
+ protected override Geometry DefiningGeometry
+ {
+ get
+ {
+ return Path;
+ }
+ }
+ }
+}