Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Hao-K/MauiProgram.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32 lines (29 sloc)
1.1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SkiaSharp.Views.Maui.Controls.Hosting; | |
namespace AppMeteoMAUI; | |
public static class MauiProgram | |
{ | |
public static MauiApp CreateMauiApp() | |
{ | |
var builder = MauiApp.CreateBuilder(); | |
builder | |
.UseMauiApp<App>() | |
.UseSkiaSharp() | |
.ConfigureFonts(fonts => | |
{ | |
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); | |
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); | |
fonts.AddFont("times new roman.ttf", "TimesNewRoman"); | |
fonts.AddFont("FiraSans-Bold.otf", "FiraSansBold"); | |
fonts.AddFont("Purple Smile.ttf", "PurpleSmile"); | |
fonts.AddFont("Requiem.ttf", "Requiem"); | |
fonts.AddFont("Low Budget.ttf", "LowBudget"); | |
}); | |
#if DEBUG | |
builder.Logging.AddDebug(); | |
#endif | |
builder.Services.AddSingleton<IGeolocation>(Geolocation.Default); | |
string dbPath = FileAccessHelper.GetFileLocalPath("Preferiti.db3"); | |
builder.Services.AddSingleton<PreferitiRepository>(s => ActivatorUtilities.CreateInstance<PreferitiRepository>(s, dbPath)); | |
return builder.Build(); | |
} | |
} |