-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMauiProgram.cs
More file actions
48 lines (43 loc) · 1.77 KB
/
MauiProgram.cs
File metadata and controls
48 lines (43 loc) · 1.77 KB
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 CommunityToolkit.Maui;
using Microsoft.Extensions.Logging;
using Syncfusion.Maui.Toolkit.Hosting;
namespace InitialSwitchColorIssue
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureSyncfusionToolkit()
.ConfigureMauiHandlers(handlers =>
{
#if IOS || MACCATALYST
handlers.AddHandler<Microsoft.Maui.Controls.CollectionView, Microsoft.Maui.Controls.Handlers.Items2.CollectionViewHandler2>();
#endif
})
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("SegoeUI-Semibold.ttf", "SegoeSemibold");
fonts.AddFont("FluentSystemIcons-Regular.ttf", FluentUI.FontFamily);
});
#if DEBUG
builder.Logging.AddDebug();
builder.Services.AddLogging(configure => configure.AddDebug());
#endif
builder.Services.AddSingleton<ProjectRepository>();
builder.Services.AddSingleton<TaskRepository>();
builder.Services.AddSingleton<CategoryRepository>();
builder.Services.AddSingleton<TagRepository>();
builder.Services.AddSingleton<SeedDataService>();
builder.Services.AddSingleton<ModalErrorHandler>();
builder.Services.AddSingleton<MainPageModel>();
builder.Services.AddTransientWithShellRoute<TaskDetailPage, TaskDetailPageModel>("task");
return builder.Build();
}
}
}