-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMauiProgram.cs
More file actions
63 lines (55 loc) · 2.03 KB
/
MauiProgram.cs
File metadata and controls
63 lines (55 loc) · 2.03 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
56
57
58
59
60
61
62
63
using Microsoft.Extensions.Logging;
using Maui.Biometric;
using BarcodeScanning;
using Qubic.Services;
using Qubic.Services.Storage;
using Qubic.Net.Wallet.Mobile.Helpers;
namespace Qubic.Net.Wallet.Mobile;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseBiometricAuthentication()
.UseBarcodeScanning()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
builder.Services.AddMauiBlazorWebView();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.SetMinimumLevel(LogLevel.Debug);
#endif
RegisterServices(builder.Services);
return builder.Build();
}
static void RegisterServices(IServiceCollection services)
{
// Defer QubicSettingsService so Android filesystem is ready
services.AddSingleton(sp =>
{
SQLitePCL.Batteries_V2.Init();
return new QubicSettingsService("QubicWallet");
});
services.AddSingleton<QubicBackendService>();
services.AddSingleton<SeedSessionService>();
services.AddSingleton<VaultService>();
services.AddSingleton<TickMonitorService>();
services.AddSingleton<TickDriftService>();
services.AddSingleton<WalletDatabase>();
services.AddSingleton<WalletSyncService>();
services.AddSingleton<WalletStorageService>();
services.AddSingleton<TransactionTrackerService>();
services.AddSingleton<AssetRegistryService>();
services.AddSingleton<PeerAutoDiscoverService>();
services.AddSingleton<QubicStaticService>();
services.AddSingleton<LabelService>();
services.AddSingleton<QrScannerService>();
services.AddSingleton<AssetCacheService>();
services.AddSingleton<BalanceService>();
services.AddSingleton<Services.AppLifecycleService>();
}
}