Skip to content

MessageBus is a cross platform EventBus system similar to NSNoticationCenter on iOS and otto on Android

License

Notifications You must be signed in to change notification settings

newky2k/MessageBus

Repository files navigation

MessageBus

MessageBus is a cross platform EventBus system similar to NSNoticationCenter on iOS and otto on Android that allow you to decouple your code, whilst still allowing your applications components to communicate with each other. MessageBus can be used instead of events, can be used to communicate between objects that are not directly linked.

Features

  • Cross-platform
    • .NETStandard 2.1, .NET 8+ including iOS, TVOS, Android, UWP, Mac and Windows with support for WPF and WinUI
  • Small footprint
  • Simple API
  • Create custom events to easily pass additional data
  • Allows you to decouple objects and classes within your projects
  • New in 3.1 - Dependency Injection support

Usage

To use Dependency Injection follow these steps.

Add package DSoft.MessageBus to your main application and call RegisterMessageBus to register the services.

private static void ConfigureServices(IServiceCollection services)
{
    services.RegisterMessageBus();
}

You can then inject IMessageBusService into your own services.

Please check the Unit tests and sample WPF app for examples of usage

Attribution

ThreadControl contains portions of code from Xamarin.Essentials, specifically the MainThread functionality

About

MessageBus is a cross platform EventBus system similar to NSNoticationCenter on iOS and otto on Android

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages