Compartilhar via


IComponentModel.GetService<T> Method

Definition

Gets a "service" from the default composition container, i.e. an object of which there can only a single instance exist in a given composition container. Equals to calling GetExportedValue<T>() directly.

public:
generic <typename T>
 where T : class T GetService();
public:
generic <typename T>
 where T : class T GetService();
template <typename T>
 where T : class T GetService();
public T GetService<T> () where T : class;
abstract member GetService : unit -> 'T (requires 'T : null)
Public Function GetService(Of T As Class) () As T

Type Parameters

T

The type of the object to get.

Returns

T

The instance of the requested object.

Applies to