Share via


ServiceManager.Publish<TServiceType> Method (PublishServiceCallback<TServiceType>)

Publishes a service of the specified type, represented by the specified method.

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

Syntax

'Declaration
Public Sub Publish(Of TServiceType) ( _
    callback As PublishServiceCallback(Of TServiceType) _
)
public void Publish<TServiceType>(
    PublishServiceCallback<TServiceType> callback
)
public:
generic<typename TServiceType>
void Publish(
    PublishServiceCallback<TServiceType>^ callback
)
member Publish : 
        callback:PublishServiceCallback<'TServiceType> -> unit 
JScript does not support generic types or methods.

Type Parameters

  • TServiceType

Parameters

Exceptions

Exception Condition
ArgumentNullException

callback is nulla null reference (Nothing in Visual Basic).

Remarks

This overload of Publish publishes the service type, but does not declare an instance of the service. When a request is made for the service, callback is invoked to create the instance. The callback is invoked only one time and the instance is cached.

.NET Framework Security

See Also

Reference

ServiceManager Class

Publish Overload

Microsoft.Windows.Design Namespace

EditingContext

ContextItem

Unsubscribe

Subscribe

Other Resources

WPF Designer Extensibility