private void Node_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { int index = m_NodeShapes.IndexOf((Ellipse)sender); if (m_Dragging) { if (DrawNodes) { } else if (DrawEdges) { if (index >= 0) { Node endNode = FloorNodes[index]; m_SelectedLine.X2 = TransformX(endNode.X); m_SelectedLine.Y2 = TransformY(endNode.Y); Edge ed = new Edge(m_StartNode, FloorNodes[index]); m_SelectedEdge = ed; m_SelectedLine = null; FloorEdges.Add(ed); m_StartNode = null; e.Handled = true; NotifyPropertyChanged("AllEdges"); updateEdges(); } } m_Dragging = false; } }
protected void removeEdge() { Edge edge = SelectedEdge; if (FloorEdges.Contains(edge)) { FloorEdges.Remove(edge); } else if (m_UnseenEdges.Contains(edge)) { m_UnseenEdges.Remove(edge); } m_SelectedNode = null; m_SelectedEdge = null; NotifyPropertyChanged("AllEdges"); updatePoints(); updateEdges(); }