Share via


ImageSourceServiceCollectionExtensions.AddService Method

Definition

Overloads

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

Registers an image service with the underlying service container via AddSingleton.

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

Registers an image service with the underlying service container via AddSingleton.

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

Source:
ImageSourceServiceCollectionExtensions.cs
Source:
ImageSourceServiceCollectionExtensions.cs

Registers an image service with the underlying service container via 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

Type Parameters

TImageSource

The image type to register for

TImageSourceService

The service type to register

Parameters

services
IImageSourceServiceCollection

The service collection

Returns

The service collection

Applies to

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

Source:
ImageSourceServiceCollectionExtensions.cs
Source:
ImageSourceServiceCollectionExtensions.cs

Registers an image service with the underlying service container via 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

Type Parameters

TImageSource

The image type to register for

Parameters

services
IImageSourceServiceCollection

The service collection

implementationFactory
Func<IServiceProvider,IImageSourceService<TImageSource>>

A factory method to create the service

Returns

The service collection

Applies to