TourIAm/TIAMMobileApp/MauiProgram.cs

50 lines
1.8 KiB
C#

using Microsoft.Extensions.Logging;
using TIAMMobileApp.Services;
using TIAMWebApp.Shared.Application.Interfaces;
using DevExpress.Blazor;
namespace TIAMMobileApp
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
builder.Services.AddMauiBlazorWebView();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
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.AddScoped(sp => client);
builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5);
builder.Services.AddScoped<IWeatherForecastService, WeatherForecastService>();
builder.Services.AddScoped<ITransferDataService, TransferDataService>();
builder.Services.AddScoped<IPopulationStructureDataProvider, PopulationStructureDataProvider>();
builder.Services.AddScoped<ISupplierService, SupplierService>();
//builder.Services.AddSingleton<WeatherForecastService>();
return builder.Build();
}
}
}