zhaw-dnet2/Tasks/Lab12/TodoDetails/MauiProgram.cs

34 lines
996 B
C#
Raw Normal View History

2024-06-06 20:52:07 +00:00
using Microsoft.Extensions.Logging;
using TodoDetails.Services;
2024-06-06 21:55:29 +00:00
using TodoDetails.View;
using TodoDetails.ViewModel;
2024-06-06 20:52:07 +00:00
namespace TodoDetails
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
builder.Logging.AddDebug();
#endif
builder.Services.AddSingleton<TodoService>();
builder.Services.AddSingleton<TodosViewModel>();
builder.Services.AddSingleton<MainPage>();
2024-06-06 21:55:29 +00:00
builder.Services.AddTransient<TodoDetailsViewModel>();
builder.Services.AddTransient<TodoDetailsPage>();
2024-06-06 20:52:07 +00:00
return builder.Build();
}
}
}