Esempio n. 1
0
        public GraphView()
        {
            InitializeComponent();

            mainWindow = App.Current.MainWindow as MainWindow;
            dataGraph  = new TestFeederGenerator.Models.GraphX();

            mainWindow.graphView = this;

            ZoomControl.SetViewFinderVisibility(zoomctrl, Visibility.Visible);
            zoomctrl.ZoomToFill();
            last_added_id = 1;

            //setup Area properties
            GraphAreaExample_Setup();

            //setup graph properties
            startGraphDrawing();


            undo.IsEnabled = false;
            redo.IsEnabled = false;

            (mainWindow.graphView.DataContext as GraphViewModel).undoRedoCommander = new UndoRedoCommander(this.DataContext);
        }
 public EdgeConfigurationView(DataVertex dv, Dictionary <string, DataVertex> globalVertices,
                              TestFeederGenerator.Models.GraphX graph, string key, Dictionary <string, List <DataEdge> > globalEdges,
                              bool isUpdate, VertexControl vc, GraphArea area, MainWindow mn,
                              Dictionary <string, Models.CableConfiguration> globalCableConfiguration,
                              EdgeControl ec = null, DataEdge de = null, VertexControl _ecFrom = null)
 {
     InitializeComponent();
     _ec          = ec;
     data         = de;
     this._ecFrom = _ecFrom;
     initializeLocalVariablesNewEdge(dv, graph, globalVertices, key, globalEdges, isUpdate, area, vc, mn, globalCableConfiguration);
     mainWindow = App.Current.MainWindow as MainWindow;
 }
 private void initializeLocalVariablesUpdateEdge(DataVertex dv, TestFeederGenerator.Models.GraphX graph, Dictionary <string, DataVertex> globalVertices, string key, Dictionary <string, List <DataEdge> > globalEdges, bool isUpdate, DataEdge de, VertexControl vc, MainWindow mn, Dictionary <string, CableConfiguration> globalCableConfiguration)
 {
     _dv                       = dv;
     _graph                    = graph;
     _globalVertices           = globalVertices;
     _key                      = key;
     _globalEdges              = globalEdges;
     idLabel.Content           = "Nodes to connect: " + dv.Text + " -> " + key;
     txtBox.Text               = de.Length.ToString();
     _isUpdate                 = isUpdate;
     _mn                       = mn;
     _vc                       = vc;
     _globalCableConfiguration = globalCableConfiguration;
     cbo.ItemsSource           = _globalCableConfiguration.Keys;
     cbo.SelectedIndex         = 0;
 }
        public EdgeConfigurationView(DataVertex dv, Dictionary <string, DataVertex> globalVertices, TestFeederGenerator.Models.GraphX graph, string key, Dictionary <string, List <DataEdge> > globalEdges, DataEdge de, bool isUpdate, MainWindow mn, VertexControl vc, Dictionary <string, Models.CableConfiguration> globalCableConfiguration)
        {
            //for update
            InitializeComponent();

            initializeLocalVariablesUpdateEdge(dv, graph, globalVertices, key, globalEdges, isUpdate, de, vc, mn, globalCableConfiguration);
        }