This is the updated version of Acr.Userdialogs. It supports latest version of .Net and you have an ability to style your dialogs as you want
$ dotnet add package Controls.UserDialogs.MauiInspired by Allan Ritchie's Acr.UserDialogs
To use, make sure you are using the latest version of .NET MAUI
Add UseUserDialogs(() => { }) to your MauiProgram.cs file
Also there is another overload which allows you to register UserDialogs instance in services and then use it with DI
UseUserDialogs(registerInterface: true, () => { })
builder
.UseMauiApp<App>()
.UseUserDialogs(() =>
{
//setup your default styles for dialogs
AlertConfig.DefaultBackgroundColor = Colors.Purple;
#if ANDROID
AlertConfig.DefaultMessageFontFamily = "OpenSans-Regular.ttf";
#else
AlertConfig.DefaultMessageFontFamily = "OpenSans-Regular";
#endif
ToastConfig.DefaultCornerRadius = 15;
})
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
I'm getting a nullreferenceexception when using loading.
I'm getting a crash if I don't set some property or argument.
<Nullable>enable</Nullable>, it means that if property or argument is not marked as nullable it must be set up.Navigating while inside of a loading/progress dialog causes exceptions or the progress no longer appears properly
I don't like the way X method works on platform Y
public class MyCustomUserDialogs : Controls.UserDialogs.Maui.UserDialogImplementation
{
public override ..
}
then in you MauiProgram.cs add this
builder
.UseMauiApp<App>()
.UseUserDialogs(() =>
{
#if ANDROID
Controls.UserDialogs.Maui.UserDialogs.Instance = new MyCustomUserDialogs(); //Android realization
#elif IOS
Controls.UserDialogs.Maui.UserDialogs.Instance = new MyCustomUserDialogs(); //iOS realization
#else
Controls.UserDialogs.Maui.UserDialogs.Instance = new MyCustomUserDialogs(); //mac realization
#endif
//setup your default styles for dialogs
})
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
Why don't you cancel a dialog when the app goes to the background (AND) why do I get an exception when I call for a dialog?
Why does the library allow me to open multiple windows?
I'd like to customize the dialogs in native way (e.g. in Android in styles or themes)