root / GES_PAC / MauiProgram.cs @ 957b1f34
Historique | Voir | Annoter | Télécharger (1,187 ko)
1 | 65ad7e66 | Lucas Bihannic | using Microsoft.Extensions.Logging; |
---|---|---|---|
2 | 18f910c6 | Lucas Bihannic | using CommunityToolkit.Maui; |
3 | using GES_PAC.Services; |
||
4 | using Microsoft.Maui.Platform; |
||
5 | using GES_PAC.View; |
||
6 | using GES_PAC.ViewModel; |
||
7 | 65ad7e66 | Lucas Bihannic | |
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 | 18f910c6 | Lucas Bihannic | .UseMauiCommunityToolkit() |
18 | .ConfigureFonts(fonts => |
||
19 | 65ad7e66 | Lucas Bihannic | { |
20 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); |
||
21 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); |
||
22 | }); |
||
23 | |||
24 | 18f910c6 | Lucas Bihannic | // 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 | 65ad7e66 | Lucas Bihannic | #if DEBUG |
40 | 18f910c6 | Lucas Bihannic | builder.Logging.AddDebug(); |
41 | 65ad7e66 | Lucas Bihannic | #endif |
42 | |||
43 | return builder.Build(); |
||
44 | } |
||
45 | } |