root / GES_PAC / MauiProgram.cs @ 1019554c
Historique | Voir | Annoter | Télécharger (1,187 ko)
1 |
using Microsoft.Extensions.Logging; |
---|---|
2 |
using CommunityToolkit.Maui; |
3 |
using GES_PAC.Services; |
4 |
using Microsoft.Maui.Platform; |
5 |
using GES_PAC.View; |
6 |
using GES_PAC.ViewModel; |
7 |
|
8 |
namespace GES_PAC; |
9 |
|
10 |
public static class MauiProgram |
11 |
{ |
12 |
public static MauiApp CreateMauiApp() |
13 |
{ |
14 |
var builder = MauiApp.CreateBuilder(); |
15 |
builder |
16 |
.UseMauiApp<App>() |
17 |
.UseMauiCommunityToolkit() |
18 |
.ConfigureFonts(fonts => |
19 |
{ |
20 |
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); |
21 |
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); |
22 |
}); |
23 |
|
24 |
// Services |
25 |
builder.Services.AddSingleton<ConnexionService>(); |
26 |
|
27 |
// Views |
28 |
builder.Services.AddSingleton<MainView>(); |
29 |
builder.Services.AddSingleton<CreatePlaceView>(); |
30 |
builder.Services.AddSingleton<CreateDayView>(); |
31 |
builder.Services.AddSingleton<CreatePersonView>(); |
32 |
|
33 |
// ViewModels |
34 |
builder.Services.AddSingleton<MainViewModel>(); |
35 |
builder.Services.AddSingleton<CreatePlaceViewModel>(); |
36 |
builder.Services.AddSingleton<CreateDayViewModel>(); |
37 |
builder.Services.AddSingleton<CreatePersonViewModel>(); |
38 |
|
39 |
#if DEBUG |
40 |
builder.Logging.AddDebug(); |
41 |
#endif |
42 |
|
43 |
return builder.Build(); |
44 |
} |
45 |
} |