Udostępnij za pośrednictwem


ServiceManager Class

Represents the behavior associated with an EditingContext.

Namespace:  Microsoft.Windows.Design
Assembly:  Microsoft.Windows.Design (in Microsoft.Windows.Design.dll)

Syntax

'Declaration
Public MustInherit Class ServiceManager _
    Implements IServiceProvider, IEnumerable(Of Type),  _
    IEnumerable
'Usage
Dim instance As ServiceManager
public abstract class ServiceManager : IServiceProvider, 
    IEnumerable<Type>, IEnumerable
public ref class ServiceManager abstract : IServiceProvider, 
    IEnumerable<Type^>, IEnumerable
public abstract class ServiceManager implements IServiceProvider, IEnumerable<Type>, IEnumerable

Remarks

The EditingContext class provides access to two pieces of state:

  • Data (ContextItem)

  • Behavior Services (ServiceManager)

Behavior services are accessed through the Services property which returns an instance of a ServiceManager.

ServiceManager is an abstract class. You can provide your own implementation by deriving from EditingContext and overriding CreateServiceManager.

Once a service is created in an EditingContext it is always present. A service cannot be removed from the EditingContext.

Services have consistent instance values, so it is always acceptable to cache them.

Code can use the ServiceManager to publish new services, and subscribe to a callback when a particular service is available.

Inheritance Hierarchy

System.Object
  Microsoft.Windows.Design.ServiceManager

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ServiceManager Members

Microsoft.Windows.Design Namespace

Other Resources

WPF Designer Extensibility