In order for any of these animations to work, you must also set
the AllowsTransparency property to True.
??? The Popup can accept focus. Thus, you can place user-interactive controls in it, such
as a Button. This functionality is one of the key reasons to use the Popup instead of the
ToolTip.
??? The Popup control is defined in the System.Windows.Controls.Primitives namespace
because it is most commonly used as a building block for more complex controls. You??™ll
find that the Popup is not quite as polished as other controls??”notably, you must set the
Background property if you want to see your content because it won??™t be inherited from
your window and you need to add the border yourself (the Border element works perfectly
well for this purpose).
Because the Popup must be shown manually, you may choose to create it entirely in code.
However, you can define it just as easily in XAML markup??”just make sure to include the
Name property so you can manipulate it in code.
CHAPTER 7 n CLASSIC CONTROLS 204
Figure 7-5 shows an example. Here, when the user moves the mouse over an underlined
word, a popup appears with more information and a link that opens an external web browser
window.
Figure 7-5. A popup with a hyperlink
To create this window, you need to include a TextBlock with the initial text and a Popup
with the additional content that you??™ll show when the user moves the mouse into the right
place.
Pages:
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398