public override void OnCreate() { base.OnCreate (); Locator.CurrentMutable.InitializeServices (); app = new HDPApp(DeviceType.ios2x, BlobCache.LocalMachine); app.Bootstrap (); var viewModelViews = Locator.Current.GetService<IViewModelViewService> (); viewModelViews.RegisterViewModels (typeof(MainActivity).Assembly); GetUserCity (); RegisterDevice (); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // If you have defined a root view controller, set it here: // window.RootViewController = myViewController; Locator.CurrentMutable.InitializeServices (); var viewModelViews = Locator.Current.GetService<IViewModelViewService> (); viewModelViews.RegisterViewModels (typeof(NewsViewController).Assembly); DeviceType deviceType; nfloat scale = UIScreen.MainScreen.Scale; if (scale == 1.0) { deviceType = DeviceType.ios; } else if (scale == 2.0) { deviceType = DeviceType.ios2x; } else { deviceType = DeviceType.ios3x; } _hdpApp = new HDPApp(deviceType); _hdpApp.Bootstrap (); window.RootViewController = new UINavigationController (new TabbedViewController()); // make the window visible window.MakeKeyAndVisible (); return true; }