public NetworkDrawingViewModel()
        {
            rendercoll       = new CompositeCollection();
            tracklines       = new ObservableCollection <Track>();
            OCPcollection    = new ObservableCollection <OCP>();
            switchcollection = new ObservableCollection <Switch>();
            penscale         = 1;
            for (int i = 0; i < DataContainer.model.infrastructure.tracks.Count; i++)
            {
                Track  temptrack = new Track();
                eTrack track     = DataContainer.model.infrastructure.tracks[i];
                if (track.trackTopology.trackEnd.geoCoord.coord.Count != 0 && track.trackTopology.trackBegin.geoCoord.coord.Count != 0)
                {
                    temptrack.track = track;
                    temptrack.index = i;
                    temptrack.X1    = track.trackTopology.trackBegin.geoCoord.coord[0];
                    temptrack.X2    = track.trackTopology.trackEnd.geoCoord.coord[0];
                    temptrack.Y1    = track.trackTopology.trackBegin.geoCoord.coord[1];
                    temptrack.Y2    = track.trackTopology.trackEnd.geoCoord.coord[1];


                    temptrack.points.Add(new Point(track.trackTopology.trackBegin.geoCoord.coord[0], track.trackTopology.trackBegin.geoCoord.coord[1]));

                    foreach (tPlacedElement point in track.trackElements.geoMappings)
                    {
                        temptrack.points.Add(new Point(point.geoCoord.coord[0], point.geoCoord.coord[1]));
                    }
                    temptrack.points.Add(new Point(track.trackTopology.trackEnd.geoCoord.coord[0], track.trackTopology.trackEnd.geoCoord.coord[1]));


                    tracklines.Add(temptrack);

                    foreach (tCommonSwitchAndCrossingData connection in track.trackTopology.connections)
                    {
                        if (connection.geoCoord.coord.Count == 2)
                        {
                            Switch sw = new Switch();
                            sw.element = connection;
                            sw.X       = connection.geoCoord.coord[0];
                            sw.Y       = connection.geoCoord.coord[1];
                            switchcollection.Add(sw);
                        }
                    }
                }
            }

            foreach (eOcp ocp in DataContainer.model.infrastructure.operationControlPoints)
            {
                OCP tempocp = new OCP();
                tempocp.ocp = ocp;
                if (ocp.geoCoord.coord.Count == 2)
                {
                    tempocp.X = ocp.geoCoord.coord[0] - tempocp.diameter / 2;
                    tempocp.Y = ocp.geoCoord.coord[1] - tempocp.diameter / 2;
                    OCPcollection.Add(tempocp);
                }
            }
            rendercoll.Add(new CollectionContainer()
            {
                Collection = tracklines
            });
            rendercoll.Add(new CollectionContainer()
            {
                Collection = OCPcollection
            });
            rendercoll.Add(new CollectionContainer()
            {
                Collection = switchcollection
            });
        }
        public NetworkDrawingViewModel()
        {
            rendercoll = new CompositeCollection();
            tracklines = new ObservableCollection<Track>();
            OCPcollection = new ObservableCollection<OCP>();
            switchcollection = new ObservableCollection<Switch>();
            penscale = 1;
            for(int i = 0; i < DataContainer.model.infrastructure.tracks.Count; i++)
            {
                Track temptrack = new Track();
                eTrack track = DataContainer.model.infrastructure.tracks[i];
                if (track.trackTopology.trackEnd.geoCoord.coord.Count != 0 && track.trackTopology.trackBegin.geoCoord.coord.Count != 0)
                {

                    temptrack.track = track;
                    temptrack.index = i;
                    temptrack.X1 = track.trackTopology.trackBegin.geoCoord.coord[0];
                    temptrack.X2 = track.trackTopology.trackEnd.geoCoord.coord[0];
                    temptrack.Y1 = track.trackTopology.trackBegin.geoCoord.coord[1];
                    temptrack.Y2 = track.trackTopology.trackEnd.geoCoord.coord[1];

                    temptrack.points.Add(new Point(track.trackTopology.trackBegin.geoCoord.coord[0],track.trackTopology.trackBegin.geoCoord.coord[1]));

                    foreach(tPlacedElement point in track.trackElements.geoMappings)
                    {
                        temptrack.points.Add(new Point(point.geoCoord.coord[0], point.geoCoord.coord[1]));
                    }
                    temptrack.points.Add(new Point(track.trackTopology.trackEnd.geoCoord.coord[0], track.trackTopology.trackEnd.geoCoord.coord[1]));

                    tracklines.Add(temptrack);

                    foreach(tCommonSwitchAndCrossingData connection in track.trackTopology.connections)
                    {
                        if (connection.geoCoord.coord.Count == 2)
                        {
                            Switch sw = new Switch();
                            sw.element = connection;
                            sw.X = connection.geoCoord.coord[0];
                            sw.Y = connection.geoCoord.coord[1];
                            switchcollection.Add(sw);
                        }
                    }

                }

            }

            foreach(eOcp ocp in DataContainer.model.infrastructure.operationControlPoints)
            {
                OCP tempocp = new OCP();
                tempocp.ocp = ocp;
                if (ocp.geoCoord.coord.Count == 2)
                {
                    tempocp.X = ocp.geoCoord.coord[0] - tempocp.diameter / 2;
                    tempocp.Y = ocp.geoCoord.coord[1] - tempocp.diameter / 2;
                    OCPcollection.Add(tempocp);
                }
            }
            rendercoll.Add(new CollectionContainer(){Collection = tracklines});
            rendercoll.Add(new CollectionContainer() { Collection = OCPcollection });
            rendercoll.Add(new CollectionContainer() {Collection = switchcollection});
        }