private void ShapeMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { captNodeShape = sender as NodeShape; if (sender is LegShape) { gbLegData.DataContext = (sender as LegShape).Leg; } }
void RemoveLegShape(NodeShape ns) { if (ns is LegShape) { canvas.Children.Remove((ns as LegShape).line); canvas.Children.Remove((ns as LegShape).point); } if (ns is SliderShape) { canvas.Children.Remove((ns as SliderShape).line); canvas.Children.Remove((ns as SliderShape).point); } }
void AddShapeToCanves(NodeShape ns) { shapeList.Add(ns); if (ns is LegShape) { canvas.Children.Add((ns as LegShape).line); canvas.Children.Add((ns as LegShape).point); } if (ns is SliderShape) { canvas.Children.Add((ns as SliderShape).line); canvas.Children.Add((ns as SliderShape).point); } ns.MouseLeftButtonDown += ShapeMouseLeftButtonDown; ns.MouseLeftButtonUp += ShapeMouseLeftButtonUp; }
private void ShapeMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { captNodeShape = null; }