MemBus + Caliburn.Micro = Lean Screen

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:

public class ShellViewModel : Conductor<Screen>
    private readonly IDisposable screenStreamDispose;

    public ShellViewModel(IObservable<RequestToActivateScreen> screenStream)
        screenStreamDispose = screenStream

    private void onNextScreenRequest(RequestToActivateScreen request)

    protected override void OnDeactivate(bool close)

The Observable is constructed based on MemBus. The screenStream is shaped with the aid of the reactive framework while “ActivateItem” loads the corresponding view for the given Screen. Overriding OnDeactivate gives a nice place to dispose of a subscription. The whole code is to be found in the MemBus “Hello World” App.


comments powered by Disqus