Selector/Selector.MAUI/MauiProgram.cs

43 lines
949 B
C#
Raw Normal View History

2023-01-21 16:55:51 +00:00
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.DependencyInjection;
2023-01-21 16:55:51 +00:00
using Selector.MAUI.Data;
using Selector.MAUI.Services;
using Selector.SignalR;
2023-01-21 16:55:51 +00:00
namespace Selector.MAUI;
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();
builder.Services.AddLogging(o =>
{
//o.AddConsole();
});
2023-01-21 16:55:51 +00:00
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
builder.Services.AddHttpClient();
2023-01-21 16:55:51 +00:00
builder.Services.AddTransient<ISelectorNetClient, SelectorNetClient>();
builder.Services.AddSingleton<SessionManager>();
builder.Services.AddSingleton<NowHubClient>();
builder.Services.AddSingleton<NowHubCache>();
2023-01-21 16:55:51 +00:00
return builder.Build();
}
}