O'Reilly logo

SignalR - Real-time Application Development - Second Edition by Einar Ingebrigtsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

MVVM

In Chapter 8, Building a WPF .NET Client, we had some help for doing MVVM from a package called Bifrost. This package does not yet support Xamarin, so we are going to borrow some of the concepts from it, although a bit more naïvely implemented. I would recommend taking a look at the source code for Bifrost (http://github.com/dolittle/bifrost), for a fully featured version. For now, however, it will do.

Messenger

The publish/subscribe mechanism we have is fairly simple to implement. Let's add the interface that represents the functionality we need:

  1. Add an interface called IMessenger in the common SignalRChat.Mobile project.
  2. Make the interface look as follows:
    public interface IMessenger { void Publish<T>(T content); void SubscribeTo<T>(Action<T> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required