-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMauiProgram.cs
More file actions
35 lines (27 loc) · 1013 Bytes
/
Copy pathMauiProgram.cs
File metadata and controls
35 lines (27 loc) · 1013 Bytes
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
using DiskPartUI.Services;
using DiskPartUI.ViewModels;
using Microsoft.Extensions.Logging;
namespace DiskPartUI;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
//The UI is entirely Blazor (see wwwroot/app.css), so no MAUI fonts or styles are needed.
builder.UseMauiApp<App>();
builder.Services.AddMauiBlazorWebView();
//Services
builder.Services.AddSingleton<DiskPartService>();
builder.Services.AddSingleton<DiskPartParser>();
builder.Services.AddSingleton<IDialogService, DialogService>();
builder.Services.AddSingleton<IFileDialogService, FileDialogService>();
//View-model and host page
builder.Services.AddSingleton<MainViewModel>();
builder.Services.AddTransient<MainPage>();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}