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:
- Add an interface called
IMessenger
in the common SignalRChat.Mobile project. - Make the interface look as follows:
public interface IMessenger { void Publish<T>(T content); void SubscribeTo<T>(Action<T> ...
Get SignalR - Real-time Application Development - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.