ToolTip

Logically, a tooltip is floating content that appears when you hover over an associated element and disappears when you move the pointer away. (Unlike a Flyout, it is meant for hovering only and is noninteractive.) 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 grey 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.13 shows a typical ToolTip in action, created from the following XAML:

<Button>   +   < ToolTipService.ToolTip >      ...

Get Universal Windows® Apps with XAML and C# 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.