The audio player
Our next step in this project is to build the user interface for controlling the audio. Add a new file called AudioPlayerPage.cs
inside the Views
folder; don't forget to add the attribute above the class declaration to register the view-model for the MVVMCross framework:
[MvxViewFor(typeof(AudioPlayerPageViewModel))] public class AudioPlayerPage : MvxViewController { private UIButton playButton; private UISlider _progressSlider; private bool _playing; private AudioPlayerPageViewModel _model; }
Note
We have declared some local scope variables that need to be used across multiple functions; you will see how these will be used later.
Now let's create the UI elements via the ViewDidLoad
function:
public override void ViewDidLoad() { base.ViewDidLoad(); var mainView = new UIView() { TranslatesAutoresizingMaskIntoConstraints = false, BackgroundColor = UIColor...