using Microsoft.Extensions.Logging; using TIAMMobileApp.Services; using TIAMWebApp.Shared.Application.Interfaces; using DevExpress.Blazor; using System.Resources; using AyCode.Interfaces.StorageHandlers; using TIAMWebApp.Shared.Application.Utility; using TIAMWebApp.Shared.Application.Services; using BlazorAnimation; using AyCode.Core.Loggers; using AyCode.Services.Loggers; using Microsoft.AspNetCore.Components.Authorization; namespace TIAMMobileApp { public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); }); builder.Services.AddMauiBlazorWebView(); #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); builder.Logging.AddDebug(); #endif builder.Services.AddLocalization(); var handler = new HttpClientHandler(); handler.ServerCertificateCustomValidationCallback = (message, certificate, chain, sslPolicyErrors) => true; var client = new HttpClient(handler); /*Windows*/ client.BaseAddress = new Uri("https://localhost:7116"); /*Android*/ //client.BaseAddress = new Uri("https://10.0.2.2:7116"); builder.Services.AddSingleton(sp => client); builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Shared.Application.Resources", typeof(Main).Assembly)); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddSingleton(); builder.Services.AddAuthorizationCore(); builder.Services.Configure(Guid.NewGuid().ToString(), c => { }); return builder.Build(); } } }