forked from ElixorTeam/Palleto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMauiProgram.cs
57 lines (44 loc) · 1.64 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
49
50
51
52
53
54
55
56
57
using BarcodeScanning;
using CommunityToolkit.Maui;
using Fluxor;
using Microsoft.Extensions.Logging;
using Microsoft.FluentUI.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Pl.Tablet.Client.Source.Shared;
using Pl.Tablet.Client.Source.Shared.Api;
using Pl.Tablet.Client.Source.Shared.Services;
using Pl.Shared.Web.Extensions;
using TailwindMerge.Extensions;
namespace Pl.Tablet.Client;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
MauiAppBuilder builder = MauiApp.CreateBuilder();
builder.Configuration.LoadAppSettings<ITabletAssembly>();
builder.UseMauiApp<App>().UseMauiCommunityToolkit();
builder.RegisterRefitClients();
builder.UseBarcodeScanning();
builder.Services.AddMauiBlazorWebView();
builder.Services.AddFluentUIComponents(c => c.ValidateClassNames = false);
builder.Services
.SetupMauiLocalizer(builder.Configuration)
.AddRefitEndpoints<ITabletAssembly>()
.AddDelegatingHandlers<ITabletAssembly>();
builder.Services.AddFluxor(options =>
{
options.WithLifetime(StoreLifetime.Singleton);
options.ScanAssemblies(typeof(ITabletAssembly).Assembly);
});
builder.Services.AddTailwindMerge();
builder.Services
.AddScoped<HtmlRenderer>()
.AddScoped<IPrintService, PrintService>()
.AddSingleton<IPrinterService, PrinterService>();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}