Ejemplo n.º 1
0
        /// <summary>
        /// Creates the way point
        /// </summary>
        /// <param name="layer">Assigned route layer</param>
        /// <param name="p">Position of the way point (world coordinates)</param>
        /// <param name="style">Style of the way point</param>
        protected WayPoint(RouteLayer layer, Point p, ShapeStyle style)
        {
            this.layer = layer;

            Width = Height = style.Size;

            // set initial position and show polyline
            // do not use Point property to avoid LocationChanged event in initialization
            ShapeCanvas.SetLocation(this, p);

            // drag and drop handlers
            InProcessDragDropBehavior.AddDragHandler(this, Drag);
            InProcessDragDropBehavior.AddDragMoveHandler(this, DragMove);
            InProcessDragDropBehavior.SetEnableDragDrop(this, true);

            // handler for context menu
            MouseRightButtonDown += WayPoint_MouseRightButtonDown;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a via way point.
        /// </summary>
        /// <param name="layer">Assigned route layer</param>
        /// <param name="p">Position of the way point (world coordinates)</param>
        /// <param name="style">Style of the way point</param>
        public Via(RouteLayer layer, System.Windows.Point p, ShapeStyle style)
            : base(layer, p, style)
        {
            Children.Add(new Ball
            {
                Color  = style.Color,
                Stroke = Colors.Black,
                Width  = style.Size,
                Height = style.Size
            });

            // must set a tool tip for the ToolTipOpening event to be raised.
            ToolTip              = "<null>";
            base.ToolTipOpening += ToolTipOpening;

            ShapeCanvas.SetAnchor(this, LocationAnchor.Center);
            layer.Shapes.Add(this);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Updates the route polylines.
 /// </summary>
 /// <param name="points">Points of the route polyline</param>
 /// <param name="toolTip">Tool tip</param>
 /// <param name="style">Display style of the route</param>
 public void UpdateRoutePolylines(IEnumerable <Point> points, string toolTip, ShapeStyle style)
 {
     finalPolyline.Update(points, toolTip, style);
     previewPolyline.Reset();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates the temporary via way point.
 /// </summary>
 /// <param name="layer">Assigned Routing layer</param>
 /// <param name="p">Position of the via way point (word coordinates)</param>
 /// <param name="style">Style of the way point</param>
 private TemporaryVia(RouteLayer layer, System.Windows.Point p, ShapeStyle style)
     : base(layer, p, style)
 {
 }