Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/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.
https://github.com/MPowerKit/Popups
Last synced: 3 months ago
JSON representation
.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.
- Host: GitHub
- URL: https://github.com/MPowerKit/Popups
- Owner: MPowerKit
- License: mit
- Created: 2023-12-14T18:05:41.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T12:18:51.000Z (3 months ago)
- Last Synced: 2024-08-16T12:17:45.939Z (3 months ago)
- Language: C#
- Size: 291 KB
- Stars: 16
- Watchers: 0
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet-maui - MPowerKit.Popups - square)](https://github.com/MPowerKit/Popups/stargazers)|[![GitHub last-commit](https://img.shields.io/github/last-commit/MPowerKit/Popups?style=flat-square)](https://github.com/MPowerKit/Popups/commits) (UI)
README
# 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](https://img.shields.io/nuget/v/MPowerKit.Popups.svg?maxAge=2592000)](https://www.nuget.org/packages/MPowerKit.Popups)
Inspired by [Rg.Plugins.Popup](https://github.com/rotorgames/Rg.Plugins.Popup) and [Mopups](https://github.com/LuckyDucko/Mopups), but implementation is completely different.
- It has almost the same PopupPage API as packages above, but improved animations, removed redundant properties as ```KeyboardOffset```, changed names of some properties.
- Improved code and fixed some known bugs, eg Android window insets (system padding) or animation flickering.
- Changed API of ```PopupService```, now you have an ability to choose a window to show/hide popup on.
- Under the hood platform specific code does not use custom renderers for ```PopupPage```.
- Hiding keyboard when tapping anywhere on popup except entry field
- ```PopupStack``` is not static from now.
- All API's are public or protected from now, so you can easily override and change implementation as you want
## Supported Platforms
* .NET8
* .NET8 for Android (min 23)
* .NET8 for iOS (min 13.0)
* .NET8 for MacCatalyst (min 13.1)
* .NET8 for Windows (min 10.0.17763.0)Note: .NET8 for Tizen is not supported, but your PRs are welcome.
## Setup
Add ```UseMPowerKitPopups()``` to your MauiProgram.cs file as next
```csharp
builder
.UseMauiApp()
.UseMPowerKitPopups();
```## Usage
You can use both registered ```IPopupService``` or static singletone ```PopupService.Current```
Inherit your popup page from ```PopupPage```:
```csharp
public class YourCustomPopup : PopupPage...
```Show popup:
```csharp
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:
```csharp
IPopupService _popupService;YourCustomPopup _popup;
await _popupService.ShowPopupAsync(_popup, desiredWindow, animated);
```Hide popup (the last one from ```PopupStack```):
```csharp
IPopupService _popupService;await _popupService.HidePopupAsync(animated);
```And overload for hiding desired popup:
```csharp
IPopupService _popupService;YourCustomPopup _popup;
await _popupService.HidePopupAsync(_popup, animated);
```Note: Don't forget to catch informative exceptions;