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; private double _currentTime; private double _endTime; private bool _updating; #endregion
Then we must add the...