MemBus + Caliburn.Micro = Lean Screen

01 Oct 2010 To be honest, without this blog post on Caliburn.Micro I was kind of stuck. But now I ended up with my Screen conductor, and it’s likely that it is not going to change a lot: [Single] public class ShellViewModel : Conductor<Screen> { private readonly IDisposable screenStreamDispose; public ShellViewModel(IObservable<RequestToActivateScreen> screenStream) {...

MemBus: Using an IoC Container to provide subscribers

27 Sep 2010 The “Observe” and “Subscribe” functionality already opens up numerous possibilities for reacting to messages. Another way to handle messages is by providing a Handler which accepts messages of a certain type: public interface IHandles<T> : ISubscription { void Push(T message); } Once we’re down to providing instances to handle available...

MemBus extension points

20 Sep 2010 ISubscription public interface ISubscription { void Push(object message); Type Handles { get; } } This is the basic structure of a subscription. There is also a typed version: public interface IHandles<T> : ISubscription { void Push(T message); } If you want to write a handler, you can inherit from the...

MemBus Rich Client showcase: A WPF Twitter Client

15 Sep 2010 After pondering a bit about the example application that should showcase MemBus, I thought that it should be a Twitter client. I think that Twitter Clients are something like the web era’s Hello World examples. The example application is found under the MemBus directory at github: http://github.com/flq/MemBus/tree/master/Membus.WpfTwitterClient/ It will use...

Using MemBus

15 Sep 2010 Usage of MemBus always goes through the IBus interface: public interface IBus : IDisposable { void Publish(object message); IDisposable Subscribe<M>(Action<M> subscription); IDisposable Subscribe<M>(Action<M> subscription, ISubscriptionShaper customization); IDisposable Subscribe<M>(Action<M> subscription, Action<ISubscriptionCustomizer<M>> customization); IObservable<M> Observe<M>(); } Whenever you want to…well…publish a message, you use the Publish method. It will accept an instance...