How can I center the tooltip above my control in Silverlight?

I want to be able to display a tooltip centered over my control.

I know how to configure the XAML used to display the tooltip using the TooltipService, however the layout options available in the TooltipService allow you to specify top, bottom, left, right, etc. They do not allow you to specify alignment once on a given side.

Just using the TooltipService, choosing the "Top" placement, put a tooltip over the control and align it on the left side of the control. If there is not enough space in it to align to the left, it moves it to align on the right side of the control.

I want the tooltip to be centered at the top of the control. I do not want him to snap to both the left and right edges.

Is it possible? How?

+3
source share
2 answers

you should check TooltipService. MSDN documentation is here . and here is a sample (WPF) from CodeProject.

0
source

Quick Snapshot: You can create your own TooltipService class to extend the capabilities of an existing one to manipulate an instance of Tooltip.

, , , TooltipService . Top Center HorizontalAlignment. , , , BetterTooltipService.

0

Source: https://habr.com/ru/post/1772683/


All Articles