Hello,
custom action sheet?
No, no handlers to custom this action shell, if you want to custom popup alert, you can use
Communitytoolkit Popup to do it.
For example, I install this CommunityToolkit.Maui, then Initializing the package in MauiProgram.cs
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
Then create a ContentPage and change the type to toolkit:Popup
, After that, you can add controls that you want. I add following controls for testing.
<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MauiApp5.MyPopUp"
>
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Start"
HorizontalOptions="Start"
FontSize="Title"
/>
<Entry
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"
/>
<Entry
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"
/>
<Button
VerticalOptions="End"
HorizontalOptions="End"
Text="login"
></Button>
</VerticalStackLayout>
</toolkit:Popup>
Do not forget to change background code's contentpage to Popup
using CommunityToolkit.Maui.Views;
namespace MauiApp5;
public partial class MyPopUp : Popup
{
public MyPopUp()
{
InitializeComponent();
}
}
By the way, if your project's .NET version is 8.0, please install CommunityToolkit.Maui to 8.0.1
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.