Compartir a través de


ImageSourceServiceCollectionExtensions.AddService Método

Definición

Sobrecargas

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

Registra un servicio de imagen con el contenedor de servicios subyacente a través de AddSingleton.

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

Registra un servicio de imagen con el contenedor de servicios subyacente a través de AddSingleton.

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

Source:
ImageSourceServiceCollectionExtensions.cs
Source:
ImageSourceServiceCollectionExtensions.cs

Registra un servicio de imagen con el contenedor de servicios subyacente a través de 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

Parámetros de tipo

TImageSource

Tipo de imagen para el que se va a registrar

TImageSourceService

Tipo de servicio que se va a registrar

Parámetros

services
IImageSourceServiceCollection

La colección de servicios

Devoluciones

La colección de servicios

Se aplica a

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

Source:
ImageSourceServiceCollectionExtensions.cs
Source:
ImageSourceServiceCollectionExtensions.cs

Registra un servicio de imagen con el contenedor de servicios subyacente a través de 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

Parámetros de tipo

TImageSource

Tipo de imagen para el que se va a registrar

Parámetros

services
IImageSourceServiceCollection

La colección de servicios

implementationFactory
Func<IServiceProvider,IImageSourceService<TImageSource>>

Un método de fábrica para crear el servicio

Devoluciones

La colección de servicios

Se aplica a