-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMauiProgram.cs
More file actions
55 lines (48 loc) · 1.75 KB
/
Copy pathMauiProgram.cs
File metadata and controls
55 lines (48 loc) · 1.75 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
49
50
51
52
53
54
55
using Manta.Helpers;
using Manta.Singletons;
using Microsoft.Extensions.Logging;
using CommunityToolkit.Maui;
using Manta.Services;
using MudBlazor.Services;
using ZXing.Net.Maui.Controls;
using HavenoSharp.Extensions;
namespace Manta;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseBarcodeReader()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
builder.Services.AddMauiBlazorWebView();
builder.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler<WebView, CustomWebViewHandler>();
});
builder.Services.AddMudServices();
builder.Services.AddSingleton<DaemonInfoSingleton>();
builder.Services.AddSingleton<BalanceSingleton>();
builder.Services.AddSingleton<NotificationSingleton>();
builder.Services.AddSingleton<TradeStatisticsSingleton>();
builder.Services.AddSingleton<DaemonConnectionSingleton>();
builder.Services.AddHavenoServices();
#if ANDROID
builder.Services.AddTransient<INotificationManagerService, AndroidNotificationManagerService>();
builder.Services.AddScoped<IHavenoDaemonService, AndroidHavenoDaemonService>();
#elif WINDOWS
builder.Services.AddTransient<INotificationManagerService, WindowsNotificationManagerService>();
builder.Services.AddScoped<IHavenoDaemonService, WindowsHavenoDaemonService>();
#endif
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}