共用方式為


ServiceManager 類別

更新:2007 年 11 月

表示與 EditingContext 相關聯的行為。

命名空間:  Microsoft.Windows.Design
組件:  Microsoft.Windows.Design (在 Microsoft.Windows.Design.dll 中)

語法

Public MustInherit Class ServiceManager _
    Implements IServiceProvider, IEnumerable(Of Type),  _
    IEnumerable

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

備註

EditingContext 類別會提供兩種狀態的存取權:

行為服務是透過 Services 屬性存取,而該屬性會傳回 ServiceManager 的執行個體。

ServiceManager 是抽象類別。您可以從 EditingContext 衍生並覆寫 CreateServiceManager,進而提供自己的實作。

一旦在 EditingContext 中建立服務,該服務就會一直存在。服務不能從 EditingContext 中移除。

服務具有一致的執行個體值,所以一律可接受進行快取。

程式碼可以使用 ServiceManager 來發行新服務,並且訂閱當特定服務可用時的回呼。

繼承階層架構

System.Object
  Microsoft.Windows.Design.ServiceManager

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。

請參閱

參考

ServiceManager 成員

Microsoft.Windows.Design 命名空間

其他資源

WPF 設計工具擴充性