You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/plugins/popups.md
+175-10
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,185 @@ uid: Plugins.Popups
4
4
5
5
# Getting Started
6
6
7
-
The Prism.Plugin.Popups package for Xamarin.Forms has been hugely popular enabling developers to leverage the PopupPage's from Rg.Plugins.Popup. Following the introduction of the [IDialogService](xref:Dialogs.GettingStarted), the Popup Plugin was updated to migrate the use of Popup Page's as Dialogs and generally help developers avoid strong dependencies on libraries like Rg.Plugins.Popup as the DialogService could be implemented in other ways in the event that the community package were to fall out of maintenance.
7
+
The `Prism.Plugin.Popups` package for Xamarin.Forms has been hugely popular, enabling developers to leverage `PopupPage` from the Rg.Plugins.Popup library. Following the introduction of the [IDialogService](xref:Dialogs.GettingStarted), the Popup Plugin was updated to transition `PopupPage` usage to dialogs. This change helps developers avoid strong dependencies on libraries like Rg.Plugins.Popup, as the `IDialogService` offers flexible implementation options should community packages become unmaintained.
8
8
9
-
For .NET MAUI Developers, the Popup Plugin will no longer be publicly available on NuGet.org. It instead will only be provided to those with a Commercial Plus license. This is in large part due to the toxic nature of many developers using the plugin over the years who make demands for changes and updates but who never bother to contribute to any Open Source project, nor both to sponsor any Open Source Developers.
9
+
For .NET MAUI developers, the Popup Plugin will no longer be publicly available on NuGet.org. Instead, it will be exclusively provided to those with a Commercial Plus license. This decision supports the project’s long-term sustainability, as maintaining and enhancing the plugin demands significant resources. Restricting access to licensed users allows us to allocate these resources effectively, ensuring continued development and improved support for our customers.
10
10
11
-
If updating your Xamarin.Forms app, particularly from older version of the Popup Plugin where you may have been using the `INavigationService`to Navigate to your Popup Pages, you will need to take time to re-architect some of your code to instead make use of the [IDialogService](xref:Dialogs.GettingStarted).
11
+
If you’re updating your Xamarin.Forms app—especially from older versions of the Popup Plugin where `INavigationService`was used to navigate to `PopupPage` instances—you’ll need to re-architect portions of your code to utilize the [IDialogService](xref:Dialogs.GettingStarted) instead.
12
12
13
-
## Registering the Popup Plugin
13
+
---
14
+
15
+
## Setup
16
+
17
+
To integrate `Prism.Plugin.Popups.Maui` into your .NET MAUI project, follow these steps:
18
+
19
+
1.**Install the NuGet Package**
20
+
Add the `Prism.Plugin.Popups.Maui` package to your .NET MAUI project using NuGet Package Manager or by running:
21
+
```
22
+
dotnet add package Prism.Plugin.Popups.Maui
23
+
```
24
+
25
+
2.**Register the Plugin**
26
+
In your `MauiProgram.cs`, configure Prism to use the plugin by adding the following code:
27
+
```csharp
28
+
builder.UseMauiApp<App>()
29
+
.UsePrism(prism=>prism.ConfigureMopupDialogs());
30
+
```
31
+
32
+
3.**Register Your Dialog Views**
33
+
Dialogs must be registered with Prism’s dialog service (not navigated to like regular pages). For example:
34
+
```csharp
35
+
containerRegistry.RegisterDialog<MyDialog>();
36
+
```
37
+
This registers a dialog view named `MyDialog` with the Prism container.
38
+
39
+
---
40
+
41
+
## Creating a Dialog View
14
42
15
-
`Rg.Plugins.Popup` does not support .NET MAUI applications, however the project has been forked and is now called `Mopups`. To use the Popup Plugin, you must be a Commercial Plus subscriber and have added the private Prism NuGet feed. You can then install `Prism.Plugin.Popups.Maui`. Once you have installed the package you simply need to call `ConfigureMopupDialogs` on the PrismAppBuilder.
43
+
A dialog view typically inherits from `ContentView` or a similar base class. You can use XAML to define the content and customize its behavior with attached properties from the `PopupDialogLayout` class.
> Using PopupPage's directly with Prism Navigation is no longer supported. PopupPage's are best used and make the most sense to be used as a Dialog. For this reason you should migrate your code to use the DialogService. Note that Prism.Plugin.Popups for .NET MAUI does expose a number of additional attached properties that you can use to configure the PopupPage that is created by the DialogService.
55
+
---
56
+
57
+
## Attached Properties
58
+
59
+
The `PopupDialogLayout` class provides several attached properties to customize popup dialogs. Below is a list of these properties, their purposes, and examples:
60
+
61
+
### `HasSystemPadding`
62
+
-**Type**: `bool`
63
+
-**Default**: `true`
64
+
-**Description**: Controls whether the popup respects system padding (e.g., status bar, navigation bar). Set to `false` for full-screen popups.
65
+
-**Example**:
66
+
```xaml
67
+
prism:PopupDialogLayout.HasSystemPadding="False"
68
+
```
69
+
70
+
### `SystemPadding`
71
+
-**Type**: `Thickness`
72
+
-**Default**: `0,0,0,0`
73
+
-**Description**: Specifies custom padding around the popup, overriding system padding if needed.
0 commit comments