Associating a Flyout

A Flyout is a piece of UI that acts like a dialog, but has light dismiss behavior. That means that tapping outside of its area automatically closes it. Flyouts are typically shown in response to a Button click, Button has a handy Flyout property that does two things:

1. Automatically attaches the Flyout to the Button so it is positioned appropriately when shown

2. Automatically shows the Flyout (with an appropriate animation) when the Button is clicked

The following XAML demonstrates the use of a Flyout in this manner, and Figure 9.2 shows what this looks like once the Button is clicked:

<Page ...>   <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">     <Button Content

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.