using CommunityToolkit.Maui; using CommunityToolkit.Mvvm.Messaging; using IntegryApiClient.MAUI; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.Logging; using MudBlazor.Services; using MudExtensions.Services; using salesbook.Maui.Core.Services; using salesbook.Shared; using salesbook.Shared.Core.Helpers; using salesbook.Shared.Core.Interface; using salesbook.Shared.Core.Messages.Activity.Copy; using salesbook.Shared.Core.Messages.Activity.New; using salesbook.Shared.Core.Messages.Back; using salesbook.Shared.Core.Services; namespace salesbook.Maui { public static class MauiProgram { private const string AppToken = "f0484398-1f8b-42f5-ab79-5282c164e1d8"; public static MauiApp CreateMauiApp() { InteractiveRenderSettings.ConfigureBlazorHybridRenderModes(); var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() .UseMauiCommunityToolkit() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); }) .UseLoginAzienda(AppToken); builder.Services.AddMauiBlazorWebView(); builder.Services.AddMudServices(); builder.Services.AddMudExtensions(); builder.Services.AddAutoMapper(typeof(MappingProfile)); builder.Services.AddAuthorizationCore(); builder.Services.AddScoped(); builder.Services.AddScoped(provider => provider.GetRequiredService()); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); //Message builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); builder.Logging.AddDebug(); #endif builder.Services.AddSingleton(); builder.Services.AddSingleton(); return builder.Build(); } } }