Udostępnij za pośrednictwem


MauiHandlersCollectionExtensions.TryAddHandler Metoda

Definicja

Przeciążenia

TryAddHandler(IMauiHandlersCollection, Type, Type)

Rejestruje procedurę obsługi w bazowym kontenerze usługi za pośrednictwem funkcji AddTransient.

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Rejestruje procedurę obsługi w bazowym kontenerze usługi za pośrednictwem funkcji AddTransient.

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

Rejestruje procedurę obsługi w bazowym kontenerze usługi za pośrednictwem funkcji AddTransient.

TryAddHandler(IMauiHandlersCollection, Type, Type)

Źródło:
MauiHandlersCollectionExtensions.cs
Źródło:
MauiHandlersCollectionExtensions.cs
Źródło:
MauiHandlersCollectionExtensions.cs

Rejestruje procedurę obsługi w bazowym kontenerze usługi za pośrednictwem funkcji 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

Parametry

handlersCollection
IMauiHandlersCollection

Kolekcja programu obsługi

viewType
Type

Typ elementu do zarejestrowania

handlerType
Type

Typ procedury obsługi, który reprezentuje element

Zwraca

Kolekcja programu obsługi

Dotyczy

TryAddHandler<TType,TTypeRender>(IMauiHandlersCollection)

Źródło:
MauiHandlersCollectionExtensions.cs
Źródło:
MauiHandlersCollectionExtensions.cs
Źródło:
MauiHandlersCollectionExtensions.cs

Rejestruje procedurę obsługi w bazowym kontenerze usługi za pośrednictwem funkcji 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

Parametry typu

TType

Typ elementu do zarejestrowania

TTypeRender

Typ procedury obsługi, który reprezentuje element

Parametry

handlersCollection
IMauiHandlersCollection

Kolekcja programu obsługi

Zwraca

Kolekcja programu obsługi

Dotyczy

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

Źródło:
MauiHandlersCollectionExtensions.cs
Źródło:
MauiHandlersCollectionExtensions.cs
Źródło:
MauiHandlersCollectionExtensions.cs

Rejestruje procedurę obsługi w bazowym kontenerze usługi za pośrednictwem funkcji 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

Parametry typu

TType

Typ elementu do zarejestrowania

Parametry

handlersCollection
IMauiHandlersCollection

Kolekcja programu obsługi

handlerImplementationFactory
Func<IServiceProvider,IElementHandler>

Metoda fabryki do utworzenia procedury obsługi

Zwraca

Kolekcja programu obsługi

Dotyczy