Beispiel #1
0
        private void contextMenuLinkToNodeButton_Click(object sender, RoutedEventArgs e)
        {
            Canvas mainCanvas = (Canvas)this.Parent;

            LinkingLine line = new LinkingLine(this);

            line.X1 = Canvas.GetLeft(this) + (this.Width / 2);
            line.Y1 = Canvas.GetTop(this) + (this.Height / 2);

            mainCanvas.Children.Add(line);

            Canvas.SetZIndex(line, 0);

            wasContextMenuOptionSelected = true;
        }
Beispiel #2
0
        private void WeightedNodeControl_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (isNewNode == true)
            {
                WeightedNodeControl nodeControl = sender as WeightedNodeControl;
                WeightedNodeControl newNode     = new WeightedNodeControl();

                isNewNode = false;

                LinkingLine line = new LinkingLine(nodeControl, newNode);
                line.X1 = Canvas.GetLeft(nodeControl) + (nodeControl.Width / 2);
                line.Y1 = Canvas.GetTop(nodeControl) + (nodeControl.Height / 2);

                mainCanvas.Children.Add(line);
                mainCanvas.Children.Add(newNode);

                Canvas.SetZIndex(line, 0);
                Canvas.SetZIndex(nodeControl, 1);
                Canvas.SetZIndex(newNode, 1);
            }
        }
Beispiel #3
0
 public void RemoveLinkingLine(LinkingLine linkingLine)
 {
     linkingLines.Remove(linkingLine);
 }
Beispiel #4
0
 public void AddLinkingLine(LinkingLine linkingLine)
 {
     linkingLines.Add(linkingLine);
 }