Home

Awesome

MPowerKit.Popups

.NET MAUI popup library which allows you to open MAUI pages as a popup. Also the library allows you to use very simple and flexible animations for showing popup pages.

NuGet

"Buy Me A Coffee"

Inspired by Rg.Plugins.Popup and Mopups, but implementation is completely different.

Supported Platforms

Note: .NET8 for Tizen is not supported, but your PRs are welcome.

Setup

Add UseMPowerKitPopups() to your MauiProgram.cs file as next

builder
    .UseMauiApp<App>()
    .UseMPowerKitPopups();

Usage

You can use both registered IPopupService or static singletone PopupService.Current

Inherit your popup page from PopupPage:

public class YourCustomPopup : PopupPage...

Show popup:

IPopupService _popupService;

YourCustomPopup _popup;

await _popupService.ShowPopupAsync(_popup, animated);

It has overload for showing popup which accepts a window of type Window, on which the popup will be shown:

IPopupService _popupService;

YourCustomPopup _popup;

await _popupService.ShowPopupAsync(_popup, desiredWindow, animated);

Hide popup (the last one from PopupStack):

IPopupService _popupService;

await _popupService.HidePopupAsync(animated);

And overload for hiding desired popup:

IPopupService _popupService;

YourCustomPopup _popup;

await _popupService.HidePopupAsync(_popup, animated);

Note: Don't forget to catch informative exceptions;