flower-story/FlowerApp/MauiProgram.cs
2023-07-19 21:01:19 +08:00

38 lines
986 B
C#

using Blahblah.FlowerApp.Controls;
using Blahblah.FlowerApp.Data;
using Blahblah.FlowerApp.Handlers;
#if DEBUG
using Microsoft.Extensions.Logging;
#endif
namespace Blahblah.FlowerApp;
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");
})
.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler<WaterfallLayout, WaterfallLayoutHandler>();
});
#if DEBUG
builder.Logging.AddDebug();
#endif
builder.Services.AddSingleton<MainPage>();
builder.Services.AddSingleton<FlowerDatabase>();
builder.Services.AddLocalization();
return builder.Build();
}
}