public wndWayPointsConfig(List <WayPoint> wayPointList) { WayPointVisualList = new List <WayPointVisual>(); WayPointsList = new List <WayPoint>(); InitializeComponent(); if ((Application.Current.MainWindow as MainWindow).Scena == null) { MessageBox.Show("нет карты"); return; } scena = (Application.Current.MainWindow as MainWindow).Scena; for (int i = 0; i < scena.ServicesList.Count; i++) { cbSevice.Items.Add(scena.ServicesList[i]); } Zoom = 4.0; PaintMap(scena.paintObjectList); lblMapSize.Content = string.Format("{0} x {1}", Math.Round(pnlMap.Width / Zoom), Math.Round(pnlMap.Height / Zoom)); for (int i = 0; i < wayPointList.Count; i++) { WayPointVisual w = new WayPointVisual() { Zoom = Zoom, Number = (i + 1).ToString(), SourcePoint = wayPointList[i] }; WayPointVisualList.Add(w); pnlMap.Children.Add(w); } }
private void pnlMap_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { Point position = e.GetPosition(pnlMap); WayPointVisual wpv = new WayPointVisual() { Zoom = Zoom, SourcePoint = new WayPoint(Convert.ToInt32(position.X / Zoom), Convert.ToInt32(position.Y / Zoom), 4, 4), Number = (WayPointVisualList.Count + 1).ToString() }; WayPointVisualList.Add(wpv); pnlMap.Children.Add(wpv); }
public wndWayPointsConfig(List<WayPoint> wayPointList) { WayPointVisualList = new List<WayPointVisual>(); WayPointsList = new List<WayPoint>(); InitializeComponent(); if ((Application.Current.MainWindow as MainWindow).Scena == null) { MessageBox.Show("нет карты"); return; } scena = (Application.Current.MainWindow as MainWindow).Scena; for (int i = 0; i < scena.ServicesList.Count; i++) { cbSevice.Items.Add(scena.ServicesList[i]); } Zoom = 4.0; PaintMap(scena.paintObjectList); lblMapSize.Content = string.Format("{0} x {1}", Math.Round(pnlMap.Width / Zoom), Math.Round(pnlMap.Height / Zoom)); for (int i = 0; i < wayPointList.Count; i++) { WayPointVisual w = new WayPointVisual() { Zoom = Zoom, Number = (i + 1).ToString(), SourcePoint = wayPointList[i] }; WayPointVisualList.Add(w); pnlMap.Children.Add(w); } }
private void pnlMap_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { Point position = e.GetPosition(pnlMap); WayPointVisual wpv = new WayPointVisual() { Zoom = Zoom, SourcePoint = new WayPoint(Convert.ToInt32(position.X / Zoom), Convert.ToInt32(position.Y / Zoom),4,4), Number = (WayPointVisualList.Count + 1).ToString() }; WayPointVisualList.Add(wpv); pnlMap.Children.Add(wpv); }