34 lines
996 B
C#
34 lines
996 B
C#
using Microsoft.Extensions.Logging;
|
|
using TodoDetails.Services;
|
|
using TodoDetails.View;
|
|
using TodoDetails.ViewModel;
|
|
|
|
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>();
|
|
builder.Services.AddTransient<TodoDetailsViewModel>();
|
|
builder.Services.AddTransient<TodoDetailsPage>();
|
|
|
|
return builder.Build();
|
|
}
|
|
}
|
|
}
|