Exemplo n.º 1
0
        private void StopMouseEnter(object sender, MouseEventArgs e)
        {
            Pushpin   stop  = e.Source as Pushpin;
            TextBlock label = stop.DataContext as TextBlock;

            Point position = e.GetPosition(MetroMap);

            position.X += 12;
            position.Y -= 50;

            Location loc = MetroMap.ViewportPointToLocation(position);

            stopLabelLayer.AddChild(label, loc);
        }
Exemplo n.º 2
0
        private void LineMouseEnter(object sender, MouseEventArgs e)
        {
            MapPolyline line  = e.OriginalSource as MapPolyline;
            UIElement   label = line.DataContext as UIElement;

            Point mousePosition = e.GetPosition((IInputElement)sender);

            mousePosition.X += 12;
            mousePosition.Y += 12;

            Location loc = MetroMap.ViewportPointToLocation(mousePosition);

            lineLabelLayer.AddChild(label, loc);
        }