-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMauiProgram.cs
47 lines (40 loc) · 1.26 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
using CommunityToolkit.Maui;
using IhandCashier.Bepe.Components;
using IhandCashier.Bepe.Configs;
using IhandCashier.Bepe.Database;
using IhandCashier.Bepe.Interfaces;
using IhandCashier.Core;
using IhandCashier.Pages.Windows;
namespace IhandCashier;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureIhandCashierCore()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("MaterialIcons-Regular.ttf", "MaterialIcons");
});
builder.Services.AddAppServices();
#region Region Service
builder.Services.AddTransient<SetupDatabase>();
#endregion
#region Region Initialize Component Provider
Core.Maui.Providers.DatagridProvider.Initialize();
#endregion
#if WINDOWS
builder.Services.AddTransient<IFolderPicker, FolderPicker>();
#elif MACCATALYST
builder.Services.AddTransient<IFolderPicker, FolderPicker>();
#endif
var app = builder.Build();
ServiceLocator.ServiceProvider = app.Services;
return app;
}
}