Exemplo n.º 1
0
        public void QueryPossibleConnections(SelectionMenu menu, DiagramViewModel diagramViewModel, ConnectorViewModel startConnector, Vector2 mousePosition)
        {
            if (startConnector.ConnectorForType.FullName == typeof(ElementNode).FullName)
            {
                menu.Items.Clear();
                var vm = InvertGraphEditor.CurrentDiagramViewModel;

                var category = new SelectionMenuCategory()
                {
                    Title = "Connect"
                };

                menu.AddItem(category);

                menu.AddItem(new SelectionMenuItem("Connect", "Create View Node and Connect to : Element", () =>
                {
                    ViewNode viewNode = new ViewNode();
                    vm.AddNode(viewNode, vm.LastMouseEvent.LastMousePosition);
                    diagramViewModel.GraphData.AddConnection(startConnector.ConnectorFor.DataObject as IConnectable, viewNode.ElementInputSlot);
                }), category);
            }
        }
Exemplo n.º 2
0
 public ViewNodeViewModel(ViewNode graphItemObject, DiagramViewModel diagramViewModel) : 
         base(graphItemObject, diagramViewModel) {
 }
Exemplo n.º 3
0
 public ViewNodeViewModelBase(ViewNode graphItemObject, uFrame.Editor.GraphUI.ViewModels.DiagramViewModel diagramViewModel) :
     base(graphItemObject, diagramViewModel)
 {
 }