Table of Contents

Interface IEventAggregator

Namespace
EasySoftware.MvvmMini.Core
Assembly
EasySoftware.MvvmMini.Core.dll

Publishes messages to subscribers without the publisher and the subscribers referencing each other.

public interface IEventAggregator

Remarks

A message reaches the subscribers registered for exactly its type T and the same key.

Methods

Publish<T>(T, string)

Publishes a message to all subscribers of type T and the given key.

void Publish<T>(T objectToSend, string key = null)

Parameters

objectToSend T

The message to send.

key string

An optional key that selects the channel; null means the default channel.

Type Parameters

T

The message type.

Reset()

Removes all subscriptions.

void Reset()

Subscribe<T>(Action<T>, string)

Subscribes an action to messages of type T.

void Subscribe<T>(Action<T> action, string key = null)

Parameters

action Action<T>

The action to invoke when a message is published.

key string

An optional key that narrows the subscription to a channel; null means the default channel.

Type Parameters

T

The message type.

Unsubscribe<T>(Action<T>, string)

Removes a subscription that was added with Subscribe<T>(Action<T>, string).

void Unsubscribe<T>(Action<T> action, string key = null)

Parameters

action Action<T>

The action to remove.

key string

The key the action was subscribed with.

Type Parameters

T

The message type.