O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ToolTip

Logically, a tooltip is floating content that appears when you hover over an associated element and disappears when you move the pointer away. The ToolTip control doesn’t perform any of this magic, however. It’s a simple content control that places its content in a white box with a gray border (in the dark theme). The magic is done by a ToolTipService class and its three attached properties. The main one is ToolTipService.ToolTip, which enables a ToolTip to be attached to any UIElement and automatically appear/disappear when appropriate. Figure 9.5 shows a typical ToolTip in action, created from the following XAML:

<Button>  +  <ToolTipService.ToolTip>     <ToolTip>       Add New Item     </ToolTip>   </ToolTipService.ToolTip> </Button ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required