Display toolTip Always as Static in WPF.How???

Jul 15, 2010 at 8:00 AM

how to get the tool tip always displayed in the Marker and not on MouseHover  in WPF???

 

in this code i found:

 

    Popup.Placement =  PlacementMode.MousePoint;
         {
           
            
            Label.Background = Brushes.Blue;
            Label.Foreground = Brushes.White;
            Label.BorderBrush = Brushes.WhiteSmoke;
            Label.BorderThickness = new Thickness(2);
            Label.Padding = new Thickness(5);
            Label.FontSize = 22;
            Label.Content = title;
         }
         Popup.Child = Label;

 

this as tooltip on Mouse Hover using  Mouse Events u created.

 

how to get the tool tip displayed always when the marker is displayed in the map.....

Jul 15, 2010 at 11:20 AM

you need integrate tooltip in the marker and set it visible when needed

Jul 15, 2010 at 2:00 PM

We integrated the Tooltip as you said but we are still not getting it. There is no bugs but some where I'm going wrong I guess. Any Help????? If you could give some examples????

 

 

 

Regards,

JankCD

Jul 16, 2010 at 4:07 AM

you need xaml examples? ;}

Jul 16, 2010 at 8:44 AM

To Add tooltip we have done a code:

 

    public  Canvas VisualRectangle()
        {
            Canvas cn = new Canvas();

            Rectangle exampleRectangle = new Rectangle();

            exampleRectangle.Width = 70;

            exampleRectangle.Height = 50;

            exampleRectangle.StrokeThickness = 3;
            exampleRectangle.RadiusX = 10;

            exampleRectangle.RadiusY = 10;
            exampleRectangle.Stroke = Brushes.Red;



            // Create a VisualBrush and use it

            // to paint the rectangle.

            VisualBrush myBrush = new VisualBrush();



            //

            // Create the brush's contents.

            //

            StackPanel aPanel = new StackPanel();



            // Create a DrawingBrush and use it to

            // paint the panel.

            DrawingBrush myDrawingBrushBrush = new DrawingBrush();

            GeometryGroup aGeometryGroup = new GeometryGroup();

            aGeometryGroup.Children.Add(new RectangleGeometry(new Rect(0, 0, 50, 50)));

            aGeometryGroup.Children.Add(new RectangleGeometry(new Rect(50, 50, 50, 50)));

            RadialGradientBrush checkerBrush = new RadialGradientBrush();

            checkerBrush.GradientStops.Add(new GradientStop(Colors.Green, 0.0));

            checkerBrush.GradientStops.Add(new GradientStop(Colors.White, 1.0));

            GeometryDrawing checkers = new GeometryDrawing(checkerBrush, null, aGeometryGroup);

            myDrawingBrushBrush.Drawing = checkers;

            aPanel.Background = myDrawingBrushBrush;



            // Create some text.

            TextBlock someText = new TextBlock();

            someText.Text = "This is Current place ";

            FontSizeConverter fSizeConverter = new FontSizeConverter();

            someText.FontSize = (double)fSizeConverter.ConvertFromString("7pt");

            someText.Margin = new Thickness(8);



            aPanel.Children.Add(someText);



            myBrush.Visual = aPanel;

            exampleRectangle.Fill = myBrush;

            cn.Children.Insert(0, exampleRectangle);


            return cn;
        }

 

this will return the canvas object with a Rectangle having Text.  but while adding markers to mainmap we have used :

 

Mainmap.Markers.Add(GmapMarker gm);

 

 

how to add this tooltip created by us using above function with the marker over here...

 

pls help.....

 

 

Jul 16, 2010 at 11:03 AM

GMapMarker m1 = new GMapMarker(start);
m1.Shape = new YourCustomMarkerWithTooltip(this, m1);

Jul 17, 2010 at 8:53 AM
Cheers......... We Got it atlast!!!!! ;} Thank uuuuuuu ;}
Jul 17, 2010 at 9:05 AM

;}