Partager via


MauiHandlersCollectionExtensions.TryAddHandler Méthode

Définition

Surcharges

TryAddHandler(IMauiHandlersCollection, Type, Type)

Inscrit un gestionnaire auprès du conteneur de service sous-jacent via AddTransient.

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Inscrit un gestionnaire auprès du conteneur de service sous-jacent via AddTransient.

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

Inscrit un gestionnaire auprès du conteneur de service sous-jacent via AddTransient.

TryAddHandler(IMauiHandlersCollection, Type, Type)

Source:
MauiHandlersCollectionExtensions.cs
Source:
MauiHandlersCollectionExtensions.cs

Inscrit un gestionnaire auprès du conteneur de service sous-jacent via 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

Paramètres

handlersCollection
IMauiHandlersCollection

Collection de gestionnaires

viewType
Type

Type d’élément à inscrire

handlerType
Type

Type de gestionnaire qui représente l’élément

Retours

Collection de gestionnaires

S’applique à

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Source:
MauiHandlersCollectionExtensions.cs
Source:
MauiHandlersCollectionExtensions.cs

Inscrit un gestionnaire auprès du conteneur de service sous-jacent via 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

Paramètres de type

TType

Type d’élément à inscrire

TTypeRender

Type de gestionnaire qui représente l’élément

Paramètres

handlersCollection
IMauiHandlersCollection

Collection de gestionnaires

Retours

Collection de gestionnaires

S’applique à

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

Source:
MauiHandlersCollectionExtensions.cs
Source:
MauiHandlersCollectionExtensions.cs

Inscrit un gestionnaire auprès du conteneur de service sous-jacent via 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

Paramètres de type

TType

Type d’élément à inscrire

Paramètres

handlersCollection
IMauiHandlersCollection

Collection de gestionnaires

handlerImplementationFactory
Func<IServiceProvider,IElementHandler>

Méthode de fabrique pour créer le gestionnaire

Retours

Collection de gestionnaires

S’applique à