![]() |
VOOZH | about |
dotnet add package Mopups --version 1.3.4
NuGet\Install-Package Mopups -Version 1.3.4
<PackageReference Include="Mopups" Version="1.3.4" />
<PackageVersion Include="Mopups" Version="1.3.4" />Directory.Packages.props
<PackageReference Include="Mopups" />Project file
paket add Mopups --version 1.3.4
#r "nuget: Mopups, 1.3.4"
#:package Mopups@1.3.4
#addin nuget:?package=Mopups&version=1.3.4Install as a Cake Addin
#tool nuget:?package=Mopups&version=1.3.4Install as a Cake Tool
<br /> <p align="center"> <h1 align="center">Mopups</h3> <p align="center"> Customisable Popups for MAUI <br /> </p> </p>
Mopups is a replacement for the "Rg.Plugins.Popups" plugin for Xamarin. Mopups intends to provide a similar experience to this plugin, however also clean up the code base and provide forward looking enhancements. Developers familar with the original plugin should find it a smooth transition, but we do recommend reading the wiki and reaching out with any issues.
The "PreBaked" is a neat blend of Mopups and AsyncAwaitBestPractices plugins to bring you a quick way to add popups into your MAUIs App using familiar concepts
Platforms Supported (Current)
Below is a video by @jfversluis introducing Mopups
First, you must follow the initialisation
You can install the nuget by looking up 'Mopups' in your nuget package manager, or by getting it here
here is an example of what this plugin makes easy (Looks slow due to giphy)
To Use the plugin for its inbuilt popup pages in a basic setting (Dual/Single Response, Login, TextInput EntryInput,and loader.) All you need are these one liners
SingleResponse Popup Page
return await SingleResponseViewModel.AutoGenerateBasicPopup(Color.HotPink, Color.Black, "I Accept", Color.Gray, "Good Job, enjoy this single response example", "thumbsup.png");
DualResponse Popup Page
return await DualResponseViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, "Okay", Color.WhiteSmoke, Color.Green, "Looks Good!", Color.DimGray, "This is an example of a dual response popup page", "thumbsup.png");
Loader Popup Page
await PreBakedMopupService.GetInstance().WrapTaskInLoader(Task.Delay(10000), Color.Blue, Color.White, LoadingReasons(), Color.Black);
Text Input PopupPage
await TextInputViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, "Cancel", Color.WhiteSmoke, Color.Green, "Submit", Color.DimGray, "Text input Example", string.Empty);
Entry Input PopupPage
await EntryInputViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, "Cancel", Color.WhiteSmoke, Color.Green, "Submit", Color.DimGray, "Text input Example", string.Empty);
LoginPage PopupPage
var (username, password) = await LoginViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, "Cancel", Color.WhiteSmoke, Color.Green, "Submit", Color.DimGray, string.Empty, "Username Here", string.Empty, "Password here", "thumbsup.png", 0, 0);
or, to return from the loader a value
await PreBakedMopupService.GetInstance().WrapReturnableTaskInLoader<bool, LoaderPopupPage>(IndepthCheckAgainstDatabase(), Color.Blue, Color.White, LoadingReasons(), Color.Black);
you can also add in synchronous functions, however they are wrapped in a task
private bool LongRunningFunction(int millisecondDelay)
{
Thread.Sleep(millisecondDelay);
return true;
}
await PreBakedMopupService.GetInstance().WrapReturnableFuncInLoader(LongRunningFunction, 6000, Color.Blue, Color.White, LoadingReasons(), Color.Black);
In Version 1.2.0, Mopups has added some pre created pages that can provide users the ability to return data from popups. I have also added the ability to overload the look of these pages and create your own.
I do wish it were simpler, however, with the limited time i have to work on this, it'll have to do.
This set of API's will be used for when the basic API wont cut it, without relying on me making another overload for every situation under the sun.
This API introduces
GeneratePopup<TPopupPage>
Which allows you to supply your own popuppage xaml which will then be attached to whatever VM you called it from.
GeneratePopup(Dictionary<string, object> propertyDictionary)
Which allows you have a dictionary of values that a popup uses, pass and automatically attach to the appropriate properties on the VM side
These are both non-static. and require you to have an instance of the ViewModel to work with. Hence
<ViewModelClassNameHere>.GenerateVM()
Which provides you with a new instance of that VM
<ViewModelClassNameHere>.PullViewModelProperties()
Which collects all the properties of a VM, and provides them to you in a dictionary, so you can reuse and also while debugging, check what exists/whats been changed
Returns this Dictionary<string, (object property, Type propertyType)>
However, for initialisation, i internally (and you can use) the following function
<ViewModelClassNameHere>.InitialiseOptionalProperties(Dictionary<string, object> optionalProperties)
Which will attempt to set each of the viewmodel properties with the corrosponding value in the dictionary
So, to fix that, i provide
<ViewModelClassNameHere>.FinalisePreparedProperties(Dictionary<string, (object property, Type propertyType)> viewModelProperties)
Which takes in the Dictionary<string, (object property, Type propertyType)> and creates Dictionary<string, object> optionalProperties
If you want to make your own Popup Page
This is the real power of this Plugin . If you look at the source for DualResponsePopupPage, or the SingleResponse version you'll notice that they are just simple Xaml Pages. Nothing fancy.
You can create the full thing yourself
InformationPopupPagePopupViewModel<TReturnable> where TReturnable is what you want the popuppage to return to its callerPopupPage (requirement to use rg plugins popup) and IGenericViewModel<TViewModel> where TViewModel is your Viewmodel, in our case it will be IGenericViewModel<InformationPopupPage>DualResponsePopupPageor you can provide your own Xaml Page, with a codebehind that inherits from PopupPage and IGenericViewModel<TViewModel> where TViewModel is the plugin provided VM you wish to use.
to use this version, just call TViewModel.GeneratePopup<YourXamlPopupPage>()
This project uses the MIT License
My Github,
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-android34.0 net8.0-android34.0 is compatible. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-ios18.0 net8.0-ios18.0 is compatible. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-maccatalyst18.0 net8.0-maccatalyst18.0 is compatible. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net8.0-windows10.0.19041 net8.0-windows10.0.19041 is compatible. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Mopups:
| Package | Downloads |
|---|---|
|
UraniumUI.Dialogs.Mopups
UraniumUI is a Free & Open-Source presentation framework for .NET MAUI. |
|
|
PolyhydraGames.Core.Maui
Package Description |
|
|
Sextant.Plugins.Popup
A ReactiveUI navigation library for Xamarin.Forms |
|
|
StellarUI.Maui.PopUp
This is the core MVVM Framework components used by Eight-Bot for building apps. A highly opinionated ReactiveUI on Rails. |
|
|
FiveHigh.Mobile.Core
Create a beautiful and easy tutorial for your .net maui application. |
Showing the top 6 popular GitHub repositories that depend on Mopups:
| Repository | Stars |
|---|---|
|
enisn/UraniumUI
The presentation framework for .NET MAUI.
|
|
|
yurkinh/Plugin.Maui.Calendar
.NET MAUI port of XF calendar plugin
|
|
|
ewerspej/maui-samples
Sample repository for various .NET MAUI, C# and MVVM features covered in blog
|
|
|
reactiveui/Sextant
A ReactiveUI navigation library for Xamarin.Forms
|
|
|
matt-goldman/Maui.Plugins.PageResolver
A simple and lightweight page resolver for use in .NET MAUI projects
|
|
|
dorisoy/Dorisoy.SIOT
一款利用.NET 8.0和MAUI框架打造的跨平台牙科治疗机物联网移动端应用,实现了对水温Speedometer监测、高速手机转速RadialGauge显示、电动马达功率检测以及光纤灯光亮度调节等功能的数据采集与仪表盘实时展示,同时支持数据可视化检测和远程操控管理。
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.3.4 | 287,336 | 5/31/2025 | |
| 1.3.3 | 26,413 | 5/16/2025 | |
| 1.3.2 | 438,365 | 10/10/2024 | |
| 1.3.1 | 469,111 | 3/8/2024 | |
| 1.3.0 | 82,136 | 1/14/2024 | |
| 1.2.0 | 127,151 | 10/9/2023 | |
| 1.1.1 | 212,210 | 2/6/2023 | |
| 1.1.0 | 77,801 | 12/5/2022 | |
| 1.0.4 | 13,276 | 10/23/2022 | |
| 1.0.3 | 1,785 | 9/18/2022 | |
| 1.0.2 | 2,011 | 8/29/2022 | |
| 1.0.1 | 3,670 | 7/13/2022 | |
| 1.0.0 | 1,828 | 6/22/2022 | |
| 1.0.0-preview.14.1 | 486 | 6/11/2022 | 1.0.0-preview.14.1 is deprecated because it is no longer maintained and has critical bugs. |
| 0.0.1 | 858 | 2/13/2022 | 0.0.1 is deprecated because it is no longer maintained and has critical bugs. |
Added in several fixes from the community (THANKYOU!)