-
Notifications
You must be signed in to change notification settings - Fork 0
/
MauiProgram.cs
40 lines (36 loc) · 1.29 KB
/
MauiProgram.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Microsoft.Extensions.Logging;
using Transport.Client;
using AV00_Control_Application.ViewModels;
using AV00_Shared.Configuration;
using AV00_Control_Application.Views;
using AV00_Control_Application.Models;
// Build trigger
namespace AV00_Control_Application
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
builder.Services.AddSingleton<IConfigurationService, ConfigurationService>();
builder.Services.AddSingleton<ITransportClient, TransportClient>();
builder.Services.AddSingleton<ApplicationMainViewModel>();
builder.Services.AddSingleton<MainPage>();
builder.Services.AddDbContext<ApplicationDbContext>();
var dbContext = new ApplicationDbContext();
dbContext.Database.EnsureCreated();
dbContext.Dispose();
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
}