PM-3349 Changed UseMauiApp init so that Android Handlers still get added

This commit is contained in:
Dinis Vieira 2023-10-07 16:56:08 +01:00
parent efb8763d3c
commit 1dcd3a3daa
No known key found for this signature in database
GPG key ID: 9389160FF6C295F3
3 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,8 @@ namespace Bit.App
#else #else
iOS.Core.Utilities.iOSCoreHelpers.ConfigureMAUIHandlers(handlers); iOS.Core.Utilities.iOSCoreHelpers.ConfigureMAUIHandlers(handlers);
#endif #endif
} },
initUseMauiApp: true
).Build(); ).Build();
} }
} }

View file

@ -10,14 +10,13 @@ namespace Bit.Core;
public static class MauiProgram public static class MauiProgram
{ {
public static MauiAppBuilder ConfigureMauiAppBuilder(Action<IEffectsBuilder> customEffectsBuilder, Action<IMauiHandlersCollection> customHandlers) public static MauiAppBuilder ConfigureMauiAppBuilder(Action<IEffectsBuilder> customEffectsBuilder, Action<IMauiHandlersCollection> customHandlers, bool initUseMauiApp = false)
{
return ConfigureBaseMauiAppBuilder(customEffectsBuilder, customHandlers)
.UseMauiApp<Bit.App.App>();
}
public static MauiAppBuilder ConfigureBaseMauiAppBuilder(Action<IEffectsBuilder> customEffectsBuilder, Action<IMauiHandlersCollection> customHandlers)
{ {
var builder = MauiApp.CreateBuilder(); var builder = MauiApp.CreateBuilder();
if(initUseMauiApp)
{
builder.UseMauiApp<Bit.App.App>();
}
builder builder
.UseMauiCommunityToolkit() .UseMauiCommunityToolkit()
.UseMauiCompatibility() .UseMauiCompatibility()

View file

@ -27,7 +27,7 @@ namespace Bit.iOS.Core.Utilities
public static void SetupMaui() public static void SetupMaui()
{ {
var builder = Bit.Core.MauiProgram.ConfigureBaseMauiAppBuilder(ConfigureMAUIEffects, ConfigureMAUIHandlers) var builder = Bit.Core.MauiProgram.ConfigureMauiAppBuilder(ConfigureMAUIEffects, ConfigureMAUIHandlers)
.UseMauiEmbedding<Application>(); .UseMauiEmbedding<Application>();
// Register the Window // Register the Window
builder.Services.Add(new ServiceDescriptor(typeof(UIWindow), UIApplication.SharedApplication.KeyWindow)); builder.Services.Add(new ServiceDescriptor(typeof(UIWindow), UIApplication.SharedApplication.KeyWindow));