private void SetupNodes()
        {
            ViewModelNode start = new ViewModelNode(this)
            {
                Name        = "Start",
                NameEnable  = false,
                CanBeDelete = false
            };

            start.Input.Visible = null;

            Nodes.Add(start);

            ViewModelNode end = new ViewModelNode(this)
            {
                Name        = "End",
                NameEnable  = false,
                CanBeDelete = false,
                Point1      = new MyPoint(100, 100)
            };

            end.TransitionsVisible = null;
            end.RollUpVisible      = null;
            Nodes.Add(end);
        }
        private ViewModelNode AddNode(MyPoint parameter, ViewModelNode result)
        {
            ViewModelNode newNode = result;

            if (result == null)
            {
                MyPoint myPoint = parameter.Copy();
                myPoint /= Scale.Value;
                newNode  = new ViewModelNode(this)
                {
                    Name   = "State " + Nodes.Count.ToString(),
                    Point1 = new MyPoint(myPoint)
                };
            }
            Nodes.Add(newNode);
            return(newNode);
        }
Beispiel #3
0
 public ViewModelConnector(ViewModelNodesCanvas nodesCanvas, ViewModelNode viewModelNode)
 {
     Node        = viewModelNode;
     NodesCanvas = nodesCanvas;
     SetupCommands();
 }
 private ViewModelNode DeleteNode(MyPoint parameter, ViewModelNode result)
 {
     Nodes.Remove(result);
     return(result);
 }