A trivial app trying to get a simple popup working
Steps taken to produce this example:
- Clean app from the Maui template in VS 17.2.0 Preview 5.0
- Add NuGets:
- CommunityToolkit.Maui
- Add the necessary lines to the app builder
- .UseMauiCommunityToolkit()
- Add a Popup page (see PopupPage)
- consider setting
CanBeDismissedByTappingOutsideOfPopup="False"
- consider adding a "Close" button
- Add a button to MainPage:
<Button Text="Popup" Clicked="Popup_Clicked" />
- Add the event handler:
private async void Popup_Clicked(object sender, EventArgs e)
{
var popup = new PopupPage();
await this.ShowPopupAsync(popup);
}