IMessengerExtensions.RegisterAll Method

Definition

Overloads

RegisterAll(IMessenger, Object)

Registers all declared message handlers for a given recipient, using the default channel.

RegisterAll<TToken>(IMessenger, Object, TToken)

Registers all declared message handlers for a given recipient.

RegisterAll(IMessenger, Object)

Registers all declared message handlers for a given recipient, using the default channel.

public static void RegisterAll (this CommunityToolkit.Mvvm.Messaging.IMessenger messenger, object recipient);
static member RegisterAll : CommunityToolkit.Mvvm.Messaging.IMessenger * obj -> unit
<Extension()>
Public Sub RegisterAll (messenger As IMessenger, recipient As Object)

Parameters

messenger
IMessenger

The IMessenger instance to use to register the recipient.

recipient
Object

The recipient that will receive the messages.

Remarks

See notes for RegisterAll<TToken>(IMessenger, Object, TToken) for more info.

Applies to

RegisterAll<TToken>(IMessenger, Object, TToken)

Registers all declared message handlers for a given recipient.

public static void RegisterAll<TToken> (this CommunityToolkit.Mvvm.Messaging.IMessenger messenger, object recipient, TToken token) where TToken : IEquatable<TToken>;
static member RegisterAll : CommunityToolkit.Mvvm.Messaging.IMessenger * obj * 'oken -> unit (requires 'oken :> IEquatable<'oken>)
<Extension()>
Public Sub RegisterAll(Of TToken As IEquatable(Of TToken)) (messenger As IMessenger, recipient As Object, token As TToken)

Type Parameters

TToken

The type of token to identify what channel to use to receive messages.

Parameters

messenger
IMessenger

The IMessenger instance to use to register the recipient.

recipient
Object

The recipient that will receive the messages.

token
TToken

The token indicating what channel to use.

Remarks

This method will register all messages corresponding to the IRecipient<TMessage> interfaces being implemented by recipient. If none are present, this method will do nothing. Note that unlike all other extensions, this method will use reflection to find the handlers to register. Once the registration is complete though, the performance will be exactly the same as with handlers registered directly through any of the other generic extensions for the IMessenger interface.

Applies to