forked from Vivelin/CatAlarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMauiProgram.cs
48 lines (43 loc) · 1.58 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
41
42
43
44
45
46
47
48
using MauiCatAlarm.Services;
using MauiCatAlarm.ViewModels;
using Microsoft.Extensions.Logging;
namespace MauiCatAlarm;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("PublicSans-Regular.ttf", "Public Sans");
fonts.AddFont("SpaceGrotesk-Regular.ttf", "Space Grotesk");
fonts.AddFont("SpaceGrotesk-Bold.ttf", "Space Grotesk Bold");
});
builder.Services.AddTransient<MainViewModel>();
//builder.Services.AddTransient<AlarmViewModel>();
builder.Services.AddTransient<SettingViewModel>();
builder.Services.AddTransient<MainPage>();
builder.Services.AddTransient<Func<MainPage>>(provider =>
{
return () => provider.GetRequiredService<MainPage>();
});
//builder.Services.AddTransient<AlarmPage>();
//builder.Services.AddTransient<Func<AlarmPage>>(provider =>
//{
// return () => provider.GetRequiredService<AlarmPage>();
//});
builder.Services.AddTransient<SettingPage>();
builder.Services.AddTransient<Func<SettingPage>>(provider =>
{
return () => provider.GetRequiredService<SettingPage>();
});
builder.Services.AddSingleton<AlarmService>();
builder.Services.AddSingleton<ShiftSetService>();
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}