I'm new to xamarin and the MvvmCross framework. I'm currently creating a multi platform application for android, windows phone and iOS. Im currently having a problem finding out what platform the app is running on.
What i want to do is to hava an if statement in the app.cs file. I want to check if this is an iOS application then do stuff, else do this. But I haven't found any good way to do this, and im not even sure it can be done in this file
Here is my code so far:
using Cirrious.CrossCore;
using Cirrious.CrossCore.IoC;
using Cirrious.MvvmCross.ViewModels;
using tax.Mobile.Core.Interfaces;
using tax.Mobile.Core.Logic;strong text
namespace tax.Mobile.Core
{
public partial class App : MvxApplication
{
public override void Initialize()
{
CreatableTypes()
.EndingWith("Service")
.AsInterfaces()
.RegisterAsLazySingleton();
#if (__iOS__)
RegisterAppStart<ViewModels.FirstViewModel>();
#else
RegisterAppStart<ViewModels.SearchViewModel>();
#endif
Mvx.RegisterType<IWebService, MockWebService>();
}
}
}
Thanks!