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 ...

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.