BindingContext.AddService Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddService(Type, Func<IServiceProvider,Object>) |
Adds the specified service factory to the binding context. |
AddService<T>(Func<IServiceProvider,T>) |
Adds the specified service factory to the binding context. |
AddService(Type, Func<IServiceProvider,Object>)
Adds the specified service factory to the binding context.
public:
void AddService(Type ^ serviceType, Func<IServiceProvider ^, System::Object ^> ^ factory);
public void AddService (Type serviceType, Func<IServiceProvider,object> factory);
member this.AddService : Type * Func<IServiceProvider, obj> -> unit
Public Sub AddService (serviceType As Type, factory As Func(Of IServiceProvider, Object))
Parameters
- serviceType
- Type
The type for which this service factory will provide an instance.
- factory
- Func<IServiceProvider,Object>
A delegate that provides an instance of the specified service type.
Applies to
AddService<T>(Func<IServiceProvider,T>)
Adds the specified service factory to the binding context.
public:
generic <typename T>
void AddService(Func<IServiceProvider ^, T> ^ factory);
public void AddService<T> (Func<IServiceProvider,T> factory);
member this.AddService : Func<IServiceProvider, 'T> -> unit
Public Sub AddService(Of T) (factory As Func(Of IServiceProvider, T))
Type Parameters
- T
The type for which this service factory will provide an instance.
Parameters
- factory
- Func<IServiceProvider,T>
A delegate that provides an instance of the specified service type.
Applies to
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για