Sharpnado.TaskLoaderView icon indicating copy to clipboard operation
Sharpnado.TaskLoaderView copied to clipboard

Host builder extension for maui

Open Axemasta opened this issue 1 year ago • 1 comments

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! 😊

Axemasta avatar Jul 24 '24 13:07 Axemasta

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?

Axemasta avatar Jul 24 '24 13:07 Axemasta

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();
	}
}

roubachof avatar Sep 09 '25 10:09 roubachof

Lovely, thanks!

Axemasta avatar Sep 09 '25 10:09 Axemasta