Edit

Share via


IMessengerExtensions.Unregister<TMessage>(IMessenger, Object) Method

Definition

Unregisters a recipient from messages of a given type.

public static void Unregister<TMessage> (this Microsoft.Toolkit.Mvvm.Messaging.IMessenger messenger, object recipient) where TMessage : class;
static member Unregister : Microsoft.Toolkit.Mvvm.Messaging.IMessenger * obj -> unit (requires 'Message : null)
<Extension()>
Public Sub Unregister(Of TMessage As Class) (messenger As IMessenger, recipient As Object)

Type Parameters

TMessage

The type of message to stop receiving.

Parameters

messenger
IMessenger

The IMessenger instance to use to unregister the recipient.

recipient
Object

The recipient to unregister.

Remarks

This method will unregister the target recipient only from the default channel. If the recipient has no registered handler, this method does nothing.

Applies to