ImageSourceServiceCollectionExtensions.AddService Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection) |
Inscrit un service d’image auprès du conteneur de service sous-jacent via AddSingleton. |
AddService<TImageSource>(IImageSourceServiceCollection, Func<IServiceProvider,IImageSourceService<TImageSource>>) |
Inscrit un service d’image auprès du conteneur de service sous-jacent via AddSingleton. |
AddService<TImageSource,TImageSourceService>(IImageSourceServiceCollection)
Inscrit un service d’image auprès du conteneur de service sous-jacent 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
Paramètres de type
- TImageSource
Type d’image à inscrire
- TImageSourceService
Type de service à inscrire
Paramètres
- services
- IImageSourceServiceCollection
Collection de services
Retours
Collection de services
S’applique à
AddService<TImageSource>(IImageSourceServiceCollection, Func<IServiceProvider,IImageSourceService<TImageSource>>)
Inscrit un service d’image auprès du conteneur de service sous-jacent 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
Paramètres de type
- TImageSource
Type d’image à inscrire
Paramètres
- services
- IImageSourceServiceCollection
Collection de services
- implementationFactory
- Func<IServiceProvider,IImageSourceService<TImageSource>>
Méthode de fabrique pour créer le service
Retours
Collection de services