AppHostBuilderExtensions.UseMauiApp Method

Definition

Overloads

UseMauiApp<TApp>(MauiAppBuilder)

Configures the MauiAppBuilder to use the specified TApp as the main application type.

UseMauiApp<TApp>(MauiAppBuilder, Func<IServiceProvider,TApp>)

Configures the MauiAppBuilder to use the specified TApp as the main application type.

UseMauiApp<TApp>(MauiAppBuilder)

Source:
AppHostBuilderExtensions.cs
Source:
AppHostBuilderExtensions.cs

Configures the MauiAppBuilder to use the specified TApp as the main application type.

public:
generic <typename TApp>
 where TApp : class, Microsoft::Maui::IApplication[System::Runtime::CompilerServices::Extension]
 static Microsoft::Maui::Hosting::MauiAppBuilder ^ UseMauiApp(Microsoft::Maui::Hosting::MauiAppBuilder ^ builder);
public static Microsoft.Maui.Hosting.MauiAppBuilder UseMauiApp<TApp> (this Microsoft.Maui.Hosting.MauiAppBuilder builder) where TApp : class, Microsoft.Maui.IApplication;
static member UseMauiApp : Microsoft.Maui.Hosting.MauiAppBuilder -> Microsoft.Maui.Hosting.MauiAppBuilder (requires 'App : null and 'App :> Microsoft.Maui.IApplication)
<Extension()>
Public Function UseMauiApp(Of TApp As {Class, IApplication}) (builder As MauiAppBuilder) As MauiAppBuilder

Type Parameters

TApp

The type to use as the application.

Parameters

builder
MauiAppBuilder

The MauiAppBuilder to configure.

Applies to

UseMauiApp<TApp>(MauiAppBuilder, Func<IServiceProvider,TApp>)

Source:
AppHostBuilderExtensions.cs
Source:
AppHostBuilderExtensions.cs

Configures the MauiAppBuilder to use the specified TApp as the main application type.

public:
generic <typename TApp>
 where TApp : class, Microsoft::Maui::IApplication[System::Runtime::CompilerServices::Extension]
 static Microsoft::Maui::Hosting::MauiAppBuilder ^ UseMauiApp(Microsoft::Maui::Hosting::MauiAppBuilder ^ builder, Func<IServiceProvider ^, TApp> ^ implementationFactory);
public static Microsoft.Maui.Hosting.MauiAppBuilder UseMauiApp<TApp> (this Microsoft.Maui.Hosting.MauiAppBuilder builder, Func<IServiceProvider,TApp> implementationFactory) where TApp : class, Microsoft.Maui.IApplication;
static member UseMauiApp : Microsoft.Maui.Hosting.MauiAppBuilder * Func<IServiceProvider, 'App (requires 'App : null and 'App :> Microsoft.Maui.IApplication)> -> Microsoft.Maui.Hosting.MauiAppBuilder (requires 'App : null and 'App :> Microsoft.Maui.IApplication)
<Extension()>
Public Function UseMauiApp(Of TApp As {Class, IApplication}) (builder As MauiAppBuilder, implementationFactory As Func(Of IServiceProvider, TApp)) As MauiAppBuilder

Type Parameters

TApp

The type to use as the application.

Parameters

builder
MauiAppBuilder

The MauiAppBuilder to configure.

implementationFactory
Func<IServiceProvider,TApp>

A factory to create the specified TApp using the services provided in a IServiceProvider.

Applies to