Sharpnado.TaskLoaderView
Sharpnado.TaskLoaderView copied to clipboard
Host builder extension for maui
It would be nice to follow the initialization pattern that maui, other .net bits and other sharpnado libs use to register this.
Something along the lines of:
public static MauiAppBuilder UseSharpnadoTaskLoaderView(this MauiAppBuilder builder, bool loggerEnable)
{
Sharpnado.TaskLoaderView.Initializer.Initialize(loggerEnable);
return builder;
}
I know its a bit pedantic, but it keeps inline with how everything else gets initialized in our apps! 😊
Looking at the source code I see a host build extension, however it doesn't seem to be available in the released version. Any ideas why?
as a matter of fact you can already use the extension (sample is using it). I just forgot to add it in the readme:
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureTaskLoader(true) // logger enabled
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
return builder.Build();
}
}
Lovely, thanks!