-4
for(int k=0;k<Config.Lines[i].Config.Stations[j].Config.Backward.Count;k++){

                _drawing.Children.Add(new Ellipse
                {   ToolTip = "Add your tooltip text here",
                    Stroke = Brushes.Black,
                    StrokeThickness = .6,
                    Width = 3,
                    Height = 3,
                    Margin = new Thickness(Config.Lines[i].Config.Stations[j].Config.Coordinate.Item1, Config.Lines[i].Config.Stations[j].Config.Coordinate.Item2+PlatformGap*(-k), 0, 0)
                });
                }

How do I put this textblock inside a tooltip? The purpose is to view this textblock only on mouse hover. Please suggest any other method also if you find one.

  • on what control are you trying to mouse hover on? – Shivani Katukota Jun 04 '18 at 06:13
  • its another object ( ellipse). I want to hover on that object and on doing so should be able to view this textbox. _drawing.Children.Add(new Ellipse { Stroke = Brushes.Black, StrokeThickness = .6, Width = 3, Height = 3, Margin = new Thickness(Config.Lines[i].Config.Stations[j].Config.Coordinate.Item1, Config.Lines[i].Config.Stations[j].Config.Coordinate.Item2+PlatformGap*(-k), 0, 0) }); } – Shubham Anand Jun 04 '18 at 06:29
  • Ellipse has a tooltip property. Why don't you set that? – Shivani Katukota Jun 04 '18 at 06:50
  • How to exactly? I am not able to get that and that is why I asked this – Shubham Anand Jun 04 '18 at 07:36

1 Answers1

-1

Ellipse has a tooltip property that you can use:

 _drawing.Children.Add(new Ellipse { ToolTip = "Add your tooltip text here", Fill = Brushes.Black, Stroke = Brushes.Black, StrokeThickness = .6, Width = 3, Height = 3, Margin = new Thickness(Config.Lines[i].Config.Stations[j].Config.Coordinate.Item1, Config.Lines[i].Config.Stations[j].Config.Coordinate.Item2+PlatformGap*(-k), 0, 0) }); } 
Shivani Katukota
  • 859
  • 9
  • 16