Radical Documentation
View on GitHub
release-1
release-1
  • Home
  • Presentation
    • AbstractViewModel
    • Conventions
      • Bootstrap Conventions
      • Runtime Conventions
      • Conventions override
    • Commands and DelegateCommand
    • IViewResolver
      • Default view behaviors
      • view life cycle events
        • Callback expectations
        • notify messages
    • Message broker MVVM built-in messages
    • Application boot process demystified
      • Application shutdown
      • Singleton applications
    • AbstractMementoViewModel
      • Simple ViewModel graphs
      • Collections and complex ViewModel graphs
    • Validation and Validation Services
  • UI Composition
    • UI Composition
      • Region content lifecycle
      • TabControl region
      • Create a custom region
  • Concepts
    • Inversion of Control
      • Castle Windsor
      • Autofac
      • Unity (v2 & v3)
      • Puzzle Container
    • Entities
      • Property System
    • Messaging and Message Broker
      • POCO messages
      • Standalone message handlers
    • Observers
      • PropertyObserver
      • MementoObserver
      • BrokerObserver
  • Memento
    • Change Tracking Service
      • MementoEntity and MementoEntityCollection
      • Handling change tracking:
        • Simple model
        • Collections
        • Complex objects graph
      • Atomic operations
      • Change Tracking Service API
      • Property Metadata for the ChangeTrackingService
      • Handling collection sync
  • Behaviors
    • DataGrid Behaviors
    • Password
    • Generic routed event handler to command behavior
    • Overlay adorner
      • Busy status manager
    • TextBox behaviors:
      • Command
      • Auto select
      • DisableUndoManager
  • Markup Extensions
    • Editor binding
    • Auto Command binding
  • How to
    • Get the view of a given view model
    • Bi-directional communication between different windows/views
    • Handle the busy status during async/long running operations
    • Implement a customer improvement program
    • Manage focus
    • Create a splash screen
    • Access view model after view is closed
    • Intercept ViewModels before it's used
Powered by GitBook
On this page
  • Subscribe
  • Broadcast & Dispatch
  1. Concepts
  2. Messaging and Message Broker

POCO messages

PreviousMessaging and Message BrokerNextStandalone message handlers

Last updated 5 years ago

The Radical supports also POCO messages, it is not required, anymore, that a class, in order to be a first class message, implements the IMessage interface.

Side note: The IMessage interface, and all the IMessageBroker operations that depends on it, are now marked as obsolete. It is highly suggested that all the message broker dependent code will be migrated to the new POCO version even if the old one will be fully supported and can safely be used in a mixed environment.

All the features supported by the old version of the message broker are supported even by the new POCO version. The only difference is in the signature of the broadcast, dispatch and subscribe methods.

Subscribe

the new available signatures are:

void Subscribe( object subscriber, object sender, Type messageType, Action<object, object> callback );
void Subscribe( object subscriber, object sender, Type messageType, InvocationModel invocationModel, Action<object, object> callback );
void Subscribe( object subscriber, Type messageType, Action<object, object> callback );
void Subscribe( object subscriber, Type messageType, InvocationModel invocationModel, Action<object, object> callback );
void Subscribe<T>( object subscriber, Action<object, T> callback );
void Subscribe<T>( object subscriber, object sender, Action<object, T> callback );
void Subscribe<T>( object subscriber, object sender, InvocationModel invocationModel, Action<object, T> callback );
void Subscribe<T>( object subscriber, InvocationModel invocationModel, Action<object, T> callback );

Where the main differences are:

  • The generics constraints have been removed;

  • The signature of the action callback delegate now has 2 parameters, instead of the single IMessage one, where the first object parameter is the sender of the message and the second is the message itself;

Broadcast & Dispatch

there is only a new simplified signature for the broadcast method:

void Broadcast( Object sender, Object message );

And even for the dispatch method things get simpler:

void Dispatch( Object sender, Object message );
message broker