다음을 통해 공유


ImageSourceServiceCollectionExtensions.AddService 메서드

정의

오버로드

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

AddSingleton을 통해 기본 서비스 컨테이너에 이미지 서비스를 등록합니다.

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

AddSingleton을 통해 기본 서비스 컨테이너에 이미지 서비스를 등록합니다.

AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)

Source:
ImageSourceServiceCollectionExtensions.cs
Source:
ImageSourceServiceCollectionExtensions.cs

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

형식 매개 변수

TImageSource

등록할 이미지 유형

TImageSourceService

등록할 서비스 유형

매개 변수

services
IImageSourceServiceCollection

서비스 컬렉션

반환

서비스 컬렉션

적용 대상

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

Source:
ImageSourceServiceCollectionExtensions.cs
Source:
ImageSourceServiceCollectionExtensions.cs

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

형식 매개 변수

TImageSource

등록할 이미지 유형

매개 변수

services
IImageSourceServiceCollection

서비스 컬렉션

implementationFactory
Func<IServiceProvider,IImageSourceService<TImageSource>>

서비스를 만드는 팩터리 메서드

반환

서비스 컬렉션

적용 대상