Skip to content

Commit

Permalink
UserDialogs Maui
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Aug 2, 2024
1 parent 9cc0e1b commit e0e343c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
19 changes: 7 additions & 12 deletions ProjectTemplates/ShinyApp/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#if debugrainbows
#if userdialogs
using Acr.UserDialogs;
#endif
#if debugrainbows
using Plugin.Maui.DebugRainbows;
#endif
#if screenrecord
Expand Down Expand Up @@ -71,6 +74,9 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp
.CreateBuilder()
.UseMauiApp<App>()
#if userdialogs
.UseUserDialogs()
#endif
#if virtuallist
.UseVirtualListView()
#endif
Expand Down Expand Up @@ -388,17 +394,6 @@ public static MauiApp CreateMauiApp()
#if storereview
builder.Services.AddSingleton(Plugin.StoreReview.CrossStoreReview.Current);
#endif
#if userdialogs
builder.Services.AddSingleton(sp =>
{
//-:cnd:noEmit
#if ANDROID
Acr.UserDialogs.UserDialogs.Init(() => sp.GetRequiredService<AndroidPlatform>().CurrentActivity);
#endif
//+:cnd:noEmit
return Acr.UserDialogs.UserDialogs.Instance;
});
#endif
#if shinyframework
builder.Services.AddDataAnnotationValidation();
#endif
Expand Down
2 changes: 1 addition & 1 deletion ProjectTemplates/ShinyApp/ShinyApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
<PackageReference Include="SkiaSharp.Extended.UI.Maui" Version="2.0.0" />
<!--#endif-->
<!--#if (userdialogs)-->
<PackageReference Include="Acr.UserDialogs" Version="9.0.0" />
<PackageReference Include="Acr.UserDialogs.Maui" Version="9.1.0" />
<!--#endif-->
<!--#if (debugrainbows)-->
<PackageReference Include="Plugin.Maui.DebugRainbows" Version="1.2.1" Condition="'$(Configuration)' == 'Debug'" />
Expand Down
2 changes: 1 addition & 1 deletion Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Shiny.NET Templates - One stop shop to setup almost everything you can imagine within your .NET MAUI application</Description>
<PackageType>Template</PackageType>
<PackageVersion>2.51.0</PackageVersion>
<PackageVersion>2.52.0</PackageVersion>
<PackageId>Shiny.Templates</PackageId>
<Title>Shiny Templates</Title>
<Authors>Allan Ritchie</Authors>
Expand Down

0 comments on commit e0e343c

Please sign in to comment.