September 2016
Intermediate to advanced
516 pages
10h 22m
English
MvxActivities are an extended object from a regular Android Activity; the app knows we are using the MVVMCross binding system.
Let's implement MainPageMvxActivity:
[Activity(Label = "Audio Player")]
public class MainPage : MvxActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetupIoC();
SetContentView(Resource.Layout.MainPage);
}
private void SetupIoC()
{
Mvx.RegisterType<ISoundHandler, SoundHandler>();
PortableMvxIoCRegistrations.InitIoC();
}
}
We will need to set up our IoC registrations in the IoC container when this activity is created. Then we simply set the content view to the XML sheet we created previously. Let's test out the Android application and click run; you should now have a MainPage ...
Read now
Unlock full access