Skip to content

MAUI

.NET MAUI is supported out of the box with Shiny by using our Shiny.Hosting.Maui package. Almost all of the lifecycle/boilerplate code is run through .NET MAUI. You only need a single line of code as shown below, to hook everything up.

First, install

Second: In your MauiProgram.cs, add the following

using Shiny;
namespace ShinyApp;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp
.CreateBuilder()
.UseMauiApp<App>()
.UseShiny() // <-- add this line (this is important) this wires shiny lifecycle through maui
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
// now wire up all of the shiny stuff and any services you need
return builder.Build();
}
}