diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-14 13:11:32 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-14 13:11:32 +0300 |
| commit | 0bf4df21349aa175405ad3b462d466a72363dee4 (patch) | |
| tree | 486fd444e7a2f17586308a05fe2a2960cab608ad /Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs | |
| parent | 9c2939ac72bdb7501ce19236c60ab5f584247fb4 (diff) | |
| download | Tango-0bf4df21349aa175405ad3b462d466a72363dee4.tar.gz Tango-0bf4df21349aa175405ad3b462d466a72363dee4.zip | |
Reorganization of solution build paths !
Optimized production packages.
Diffstat (limited to 'Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.EmbroideryUI/EmbroideryPath.cs | 86 |
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; + } + } + } +} |
