Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created June 15, 2021 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/2282e7bbb8469403b7a3a60c11b0bc63 to your computer and use it in GitHub Desktop.
Save lgolubyev/2282e7bbb8469403b7a3a60c11b0bc63 to your computer and use it in GitHub Desktop.
public class Application : MauiApp
{
public override IAppHostBuilder CreateBuilder() =>
base.CreateBuilder()
.RegisterCompatibilityRenderers()
.ConfigureServices((ctx, services) =>
{
services.AddTransient<MainPage>();
services.AddTransient<IWindow, MainWindow>();
})
.ConfigureFonts((hostingContext, fonts) =>
{
fonts.AddFont("ionicons.ttf", "IonIcons");
});
public override IWindow CreateWindow(IActivationState state)
{
Microsoft.Maui.Controls.Compatibility.Forms.Init(state);
return Services.GetService<IWindow>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment