Example #1
0
        public static void Y2_PC(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            lineControl c  = obj as lineControl;
            double      nv = (double)e.NewValue;

            c.Y2 = c.line.Y2 = nv;
            c.ChangeAnimationValue();
        }
Example #2
0
        private void Canvas_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Line = new lineControl()
            {
                X1 = (Line == null) ? Mouse.GetPosition(this).X - canvas.Margin.Left : Line.X2,
                Y1 = (Line == null) ? Mouse.GetPosition(this).Y - canvas.Margin.Top : Line.Y2,
                X2 = Mouse.GetPosition(this).X - canvas.Margin.Left,
                Y2 = Mouse.GetPosition(this).Y - canvas.Margin.Top
            };
            Line.line.StrokeThickness = 2; //шырина линии

            _lines.Add(Line);
            canvas.Children.Add(Line);
        }
Example #3
0
 private void Canvas_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
 {
     SetLinePosition(Mode);
     Line = null;
 }