private void StartApplication() { if (_window.Subviews.Length == 0) { // toss in a temporary view until async initialization is complete string bitmapFile = string.Empty; MXTouchContainerOptions options = Attribute.GetCustomAttribute(_appDelegate.GetType(), typeof(MXTouchContainerOptions)) as MXTouchContainerOptions; if (options != null) { bitmapFile = options.SplashBitmap; } _splashViewController = new SplashViewController(bitmapFile); _window.AddSubview(_splashViewController.View); _window.MakeKeyAndVisible(); } }
public void ShowSplashView(bool show = true) { if (show) { this.window.BringSubviewToFront(this.splashViewController.View); this.splashViewController.View.Hidden = false; } else { if (this.splashViewController != null) { this.splashViewController.View.Hidden = true; this.splashViewController.View.RemoveFromSuperview(); this.splashViewController.Dispose(); this.splashViewController = null; } } }
public void Init(UIViewController viewController) { _masterNavigationController = new UINavigationController(viewController); _masterNavigationController.NavigationBar.TintColor = UIColor.FromRGB(0, 61, 109); if (IsTablet && _tabletOptions.TabletLayout == TabletLayout.MasterPane) { // toss a generic view in the detail pane _splashViewController = new SplashViewController(_options.SplashBitmap); _detailNavigationController = new UINavigationController(_splashViewController); // initialize the SplitPane _splitViewController = new MGSplitViewController(); _splitViewController.SetViewControllers(new UIViewController[2] { _masterNavigationController, _detailNavigationController }); _splitViewController.SetShowsMasterInPortrait(_tabletOptions.MasterShowsinPotrait); _splitViewController.SetShowsMasterInLandscape(_tabletOptions.MasterShowsinLandscape); _splitViewController.SetMasterBeforeDetail(_tabletOptions.MasterBeforeDetail); if (_tabletOptions.AllowDividerResize) { _splitViewController.SetDividerStyle(MGSplitViewDividerStyle.PaneSplitter); } else { _splitViewController.SetDividerStyle(MGSplitViewDividerStyle.Thin); } // primary view with be the split view this.View = _splitViewController.View; if (_options.NavigationBarTintColor != UIColor.Clear) { _masterNavigationController.NavigationBar.TintColor = _options.NavigationBarTintColor; _detailNavigationController.NavigationBar.TintColor = _options.NavigationBarTintColor; } } else { // we are an iPhone, skip the split view and use the navigation controller instead! this.View = _masterNavigationController.View; } }
public void Init(UIViewController viewController) { _masterNavigationController = new UINavigationController(viewController); if (IsTablet && _tabletOptions.TabletLayout == TabletLayout.MasterPane) { // toss a generic view in the detail pane _splashViewController = new SplashViewController(_options.SplashBitmap); _detailNavigationController = new UINavigationController(_splashViewController); // initialize the SplitPane _splitViewController = new MGSplitViewController(); // added the following to set RootViewController _splitViewController.SetViewControllers(new UIViewController[2] { _masterNavigationController, _detailNavigationController }); _splitViewController.SetShowsMasterInPortrait(_tabletOptions.MasterShowsinPotrait); _splitViewController.SetShowsMasterInLandscape(_tabletOptions.MasterShowsinLandscape); _splitViewController.SetMasterBeforeDetail(_tabletOptions.MasterBeforeDetail); if (_tabletOptions.AllowDividerResize) _splitViewController.SetDividerStyle(MGSplitViewDividerStyle.PaneSplitter); else _splitViewController.SetDividerStyle(MGSplitViewDividerStyle.Thin); if (_window != null) _window.RootViewController = _splitViewController; // primary view with be the split view this.View = _splitViewController.View; if (_options.NavigationBarTintColor != UIColor.Clear) { _masterNavigationController.NavigationBar.TintColor = _options.NavigationBarTintColor; _detailNavigationController.NavigationBar.TintColor = _options.NavigationBarTintColor; } } else { // we are an iPhone, skip the split view and use the navigation controller instead! this.View = _masterNavigationController.View; _window.RootViewController = _masterNavigationController; } }