liveBook · Manning

Popup

As explained in .NET MAUI in Action

A popup is a .NET MAUI Community Toolkit user-interface element that displays transient content above the current page.

A popup is a .NET MAUI Community Toolkit UI element for displaying transient content above the current page. Create one by installing CommunityToolkit.Maui, registering UseMauiCommunityToolkit(), and changing a ContentPage into a Popup. section 6.2.2

A practical popup implementation typically includes:

  • Declare mct:Popup in XAML, remove the ContentPage Title, and set a size such as 600 by 600. section 6.2.2
  • Pass data through the constructor, expose bindable properties or collections, and set BindingContext to the popup. section 6.2.2
  • Handle selection changes and close with a result, including a result when the user taps outside. section 6.2.2

Genre selection and movie details

A movie application uses one popup for a multi-select genre list and another for movie details. The genre popup binds a CollectionView to an ObservableCollection<UserGenre>, tracks whether selection changed, and returns that state on confirmation or outside dismissal. The details popup binds title, description, poster, rating, and genre names from a MovieResult. section 6.2.2

builder.UseMauiApp<App>().ConfigureFonts().UseMauiCommunityToolkit();

Use the toolkit registration line as the first configuration step before creating popup pages. section 6.2.2

How .NET MAUI in Action covers it

How deep it goes
Builds popups through package setup, XAML conversion, sizing, data binding, selection handling, and result-based closing.
Examples
Uses a multi-select genre list and a movie-details view with poster, rating, description, and genres.
What it assumes
Assumes basic .NET MAUI ContentPage, XAML, C#, constructors, and data-binding familiarity.
What you can do after
Apply it via CommunityToolkit.Maui to build data-bound, sized popups that return interaction results.
How it connects
Connects ContentPage conversion, XAML, data binding, ObservableCollection, CollectionView selection, and popup results.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.