Sdílet prostřednictvím


ImageSourceServiceCollectionExtensions.AddService Metoda

Definice

Přetížení

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

Zaregistruje službu image do základního kontejneru služby prostřednictvím AddSingleton.

AddService<TImageSource>(IImageSourceServiceCollection, Func<IServiceProvider,IImageSourceService<TImageSource>>)

Zaregistruje službu image do základního kontejneru služby prostřednictvím AddSingleton.

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

Zdroj:
ImageSourceServiceCollectionExtensions.cs
Zdroj:
ImageSourceServiceCollectionExtensions.cs

Zaregistruje službu image do základního kontejneru služby prostřednictvím AddSingleton.

public:
generic <typename TImageSource, typename TImageSourceService>
 where TImageSource : Microsoft::Maui::IImageSource where TImageSourceService : class, Microsoft::Maui::IImageSourceService<TImageSource>[System::Runtime::CompilerServices::Extension]
 static Microsoft::Maui::Hosting::IImageSourceServiceCollection ^ AddService(Microsoft::Maui::Hosting::IImageSourceServiceCollection ^ services);
public static Microsoft.Maui.Hosting.IImageSourceServiceCollection AddService<TImageSource,TImageSourceService> (this Microsoft.Maui.Hosting.IImageSourceServiceCollection services) where TImageSource : Microsoft.Maui.IImageSource where TImageSourceService : class, Microsoft.Maui.IImageSourceService<TImageSource>;
static member AddService : Microsoft.Maui.Hosting.IImageSourceServiceCollection -> Microsoft.Maui.Hosting.IImageSourceServiceCollection (requires 'ImageSource :> Microsoft.Maui.IImageSource and 'ImageSourceService : null and 'ImageSourceService :> Microsoft.Maui.IImageSourceService<'ImageSource>)
<Extension()>
Public Function AddService(Of TImageSource As IImageSource, TImageSourceService As IImageSource) (services As IImageSourceServiceCollection) As IImageSourceServiceCollection

Parametry typu

TImageSource

Typ image, pro který se má zaregistrovat

TImageSourceService

Typ služby, která se má zaregistrovat

Parametry

services
IImageSourceServiceCollection

Kolekce služby

Návraty

Kolekce služby

Platí pro

AddService<TImageSource>(IImageSourceServiceCollection, Func<IServiceProvider,IImageSourceService<TImageSource>>)

Zdroj:
ImageSourceServiceCollectionExtensions.cs
Zdroj:
ImageSourceServiceCollectionExtensions.cs

Zaregistruje službu image do základního kontejneru služby prostřednictvím AddSingleton.

public:
generic <typename TImageSource>
 where TImageSource : Microsoft::Maui::IImageSource[System::Runtime::CompilerServices::Extension]
 static Microsoft::Maui::Hosting::IImageSourceServiceCollection ^ AddService(Microsoft::Maui::Hosting::IImageSourceServiceCollection ^ services, Func<IServiceProvider ^, Microsoft::Maui::IImageSourceService<TImageSource> ^> ^ implementationFactory);
public static Microsoft.Maui.Hosting.IImageSourceServiceCollection AddService<TImageSource> (this Microsoft.Maui.Hosting.IImageSourceServiceCollection services, Func<IServiceProvider,Microsoft.Maui.IImageSourceService<TImageSource>> implementationFactory) where TImageSource : Microsoft.Maui.IImageSource;
static member AddService : Microsoft.Maui.Hosting.IImageSourceServiceCollection * Func<IServiceProvider, Microsoft.Maui.IImageSourceService<'ImageSource>> -> Microsoft.Maui.Hosting.IImageSourceServiceCollection (requires 'ImageSource :> Microsoft.Maui.IImageSource)
<Extension()>
Public Function AddService(Of TImageSource As IImageSource) (services As IImageSourceServiceCollection, implementationFactory As Func(Of IServiceProvider, IImageSourceService(Of TImageSource))) As IImageSourceServiceCollection

Parametry typu

TImageSource

Typ image, pro který se má zaregistrovat

Parametry

services
IImageSourceServiceCollection

Kolekce služby

implementationFactory
Func<IServiceProvider,IImageSourceService<TImageSource>>

Metoda továrny pro vytvoření služby

Návraty

Kolekce služby

Platí pro