-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IUserDialogs is now registered with service collection
Refactored the MauiAppBuilder extension to be shared by all platforms, add servicecollection registation for instance
- Loading branch information
Showing
5 changed files
with
16 additions
and
42 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
Controls.UserDialogs.Maui/Platforms/Android/UserDialogs.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
Controls.UserDialogs.Maui/Platforms/MacCatalyst/UserDialogs.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
Controls.UserDialogs.Maui/Shared/MauiAppBuilderExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Controls.UserDialogs.Maui; | ||
|
||
public static class MauiAppBuilderExtension | ||
{ | ||
public static MauiAppBuilder UseUserDialogs(this MauiAppBuilder builder, Action configure = null) | ||
{ | ||
UserDialogs.Instance = new UserDialogsImplementation(); | ||
|
||
configure?.Invoke(); | ||
|
||
builder.Services.AddTransient((s) => UserDialogs.Instance); | ||
|
||
return builder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters