Condividi tramite


MauiHandlersCollectionExtensions.TryAddHandler Metodo

Definizione

Overload

TryAddHandler(IMauiHandlersCollection, Type, Type)

Registra un gestore con il contenitore del servizio sottostante tramite AddTransient.

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Registra un gestore con il contenitore del servizio sottostante tramite AddTransient.

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

Registra un gestore con il contenitore del servizio sottostante tramite AddTransient.

TryAddHandler(IMauiHandlersCollection, Type, Type)

Origine:
MauiHandlersCollectionExtensions.cs
Origine:
MauiHandlersCollectionExtensions.cs

Registra un gestore con il contenitore del servizio sottostante tramite 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

Parametri

handlersCollection
IMauiHandlersCollection

Raccolta del gestore

viewType
Type

Tipo di elemento da registrare

handlerType
Type

Tipo di gestore che rappresenta l'elemento

Restituisce

Raccolta del gestore

Si applica a

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Origine:
MauiHandlersCollectionExtensions.cs
Origine:
MauiHandlersCollectionExtensions.cs

Registra un gestore con il contenitore del servizio sottostante tramite 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

Parametri di tipo

TType

Tipo di elemento da registrare

TTypeRender

Tipo di gestore che rappresenta l'elemento

Parametri

handlersCollection
IMauiHandlersCollection

Raccolta del gestore

Restituisce

Raccolta del gestore

Si applica a

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

Origine:
MauiHandlersCollectionExtensions.cs
Origine:
MauiHandlersCollectionExtensions.cs

Registra un gestore con il contenitore del servizio sottostante tramite 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

Parametri di tipo

TType

Tipo di elemento da registrare

Parametri

handlersCollection
IMauiHandlersCollection

Raccolta del gestore

handlerImplementationFactory
Func<IServiceProvider,IElementHandler>

Metodo factory per creare il gestore

Restituisce

Raccolta del gestore

Si applica a