Compartilhar via


MauiHandlersCollectionExtensions.TryAddHandler Método

Definição

Sobrecargas

TryAddHandler(IMauiHandlersCollection, Type, Type)

Registra um manipulador com o contêiner de serviço subjacente por meio de AddTransient.

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Registra um manipulador com o contêiner de serviço subjacente por meio de AddTransient.

TryAddHandler<TType>(IMauiHandlersCollection, Func<IServiceProvider,IElementHandler>)

Registra um manipulador com o contêiner de serviço subjacente por meio de AddTransient.

TryAddHandler(IMauiHandlersCollection, Type, Type)

Origem:
MauiHandlersCollectionExtensions.cs
Origem:
MauiHandlersCollectionExtensions.cs

Registra um manipulador com o contêiner de serviço subjacente por meio de AddTransient.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Maui::Hosting::IMauiHandlersCollection ^ TryAddHandler(Microsoft::Maui::Hosting::IMauiHandlersCollection ^ handlersCollection, Type ^ viewType, Type ^ handlerType);
public static Microsoft.Maui.Hosting.IMauiHandlersCollection TryAddHandler (this Microsoft.Maui.Hosting.IMauiHandlersCollection handlersCollection, Type viewType, Type handlerType);
static member TryAddHandler : Microsoft.Maui.Hosting.IMauiHandlersCollection * Type * Type -> Microsoft.Maui.Hosting.IMauiHandlersCollection
<Extension()>
Public Function TryAddHandler (handlersCollection As IMauiHandlersCollection, viewType As Type, handlerType As Type) As IMauiHandlersCollection

Parâmetros

handlersCollection
IMauiHandlersCollection

A coleção de manipuladores

viewType
Type

O tipo de elemento a ser registrado

handlerType
Type

O tipo de manipulador que representa o elemento

Retornos

A coleção de manipuladores

Aplica-se a

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Origem:
MauiHandlersCollectionExtensions.cs
Origem:
MauiHandlersCollectionExtensions.cs

Registra um manipulador com o contêiner de serviço subjacente por meio de AddTransient.

public:
generic <typename TType, typename TTypeRender>
 where TType : Microsoft::Maui::IView where TTypeRender : Microsoft::Maui::IViewHandler[System::Runtime::CompilerServices::Extension]
 static Microsoft::Maui::Hosting::IMauiHandlersCollection ^ TryAddHandler(Microsoft::Maui::Hosting::IMauiHandlersCollection ^ handlersCollection);
public static Microsoft.Maui.Hosting.IMauiHandlersCollection TryAddHandler<TType,TTypeRender> (this Microsoft.Maui.Hosting.IMauiHandlersCollection handlersCollection) where TType : Microsoft.Maui.IView where TTypeRender : Microsoft.Maui.IViewHandler;
static member TryAddHandler : Microsoft.Maui.Hosting.IMauiHandlersCollection -> Microsoft.Maui.Hosting.IMauiHandlersCollection (requires 'ype :> Microsoft.Maui.IView and 'ypeRender :> Microsoft.Maui.IViewHandler)
<Extension()>
Public Function TryAddHandler(Of TType As IView, TTypeRender As IView) (handlersCollection As IMauiHandlersCollection) As IMauiHandlersCollection

Parâmetros de tipo

TType

O tipo de elemento a ser registrado

TTypeRender

O tipo de manipulador que representa o elemento

Parâmetros

handlersCollection
IMauiHandlersCollection

A coleção de manipuladores

Retornos

A coleção de manipuladores

Aplica-se a

TryAddHandler<TType>(IMauiHandlersCollection, Func<IServiceProvider,IElementHandler>)

Origem:
MauiHandlersCollectionExtensions.cs
Origem:
MauiHandlersCollectionExtensions.cs

Registra um manipulador com o contêiner de serviço subjacente por meio de AddTransient.

public:
generic <typename TType>
 where TType : Microsoft::Maui::IElement[System::Runtime::CompilerServices::Extension]
 static Microsoft::Maui::Hosting::IMauiHandlersCollection ^ TryAddHandler(Microsoft::Maui::Hosting::IMauiHandlersCollection ^ handlersCollection, Func<IServiceProvider ^, Microsoft::Maui::IElementHandler ^> ^ handlerImplementationFactory);
public static Microsoft.Maui.Hosting.IMauiHandlersCollection TryAddHandler<TType> (this Microsoft.Maui.Hosting.IMauiHandlersCollection handlersCollection, Func<IServiceProvider,Microsoft.Maui.IElementHandler> handlerImplementationFactory) where TType : Microsoft.Maui.IElement;
static member TryAddHandler : Microsoft.Maui.Hosting.IMauiHandlersCollection * Func<IServiceProvider, Microsoft.Maui.IElementHandler> -> Microsoft.Maui.Hosting.IMauiHandlersCollection (requires 'ype :> Microsoft.Maui.IElement)
<Extension()>
Public Function TryAddHandler(Of TType As IElement) (handlersCollection As IMauiHandlersCollection, handlerImplementationFactory As Func(Of IServiceProvider, IElementHandler)) As IMauiHandlersCollection

Parâmetros de tipo

TType

O tipo de elemento a ser registrado

Parâmetros

handlersCollection
IMauiHandlersCollection

A coleção de manipuladores

handlerImplementationFactory
Func<IServiceProvider,IElementHandler>

Um método de fábrica para criar o manipulador

Retornos

A coleção de manipuladores

Aplica-se a