O'Reilly logo

Xamarin Blueprints by Michael Williams

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

Creating AudioPlayerPageViewModel

Our AudioPlayerPageViewModel must include our ISoundHandler interface. We are going to be controlling the audio from this view-model, so our buttons can initiate the required events on the sound handler. Let's begin by making a new file inside the ViewModels folder called AudioPlayerPageViewModel.cs, and implementing the private properties to begin with:

public class AudioPlayerPageViewModel : MvxViewModel { #region Private Properties private readonly ISoundHandler _soundHandler; private string _title = "Audio Player"; private string _descriptionMessage = "Moby - The Only Thing"; private MvxCommand _playPauseCommand; private MvxCommand _forwardCommand; private MvxCommand _rewindCommand; private float _audioPosition; ...

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