Example #1
0
		public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
		{
			this.LaunchActions = new Queue<Action<CheckPointController>>();
			this.Commands = new CommandManager();

			LoadOptions();

			application.SetMinimumBackgroundFetchInterval(UIApplication.BackgroundFetchIntervalMinimum);

			var PerformAdditionalHandling = true;
			if (launchOptions != null)
			{
				this.LastShortcutItem = launchOptions[UIApplication.LaunchOptionsShortcutItemKey] as UIApplicationShortcutItem;
				PerformAdditionalHandling = (LastShortcutItem == null);
			}

			this.Window = new UIWindow(UIScreen.MainScreen.Bounds);
			var root = new RootViewController();
			this.Sidebar = root.SideBar;
			Window.RootViewController = root;
			Window.MakeKeyAndVisible();

			this.DataModelConstructor = new Task<DataModel>(() =>
			{
				DataModel dm;
				using (new TrackingBenchmark() { Category = "DataModel", Name = "Load" })
					 dm = new DataModel(DefaultDataProvider);
				
				return dm;
			});
				
			this.DataModelConstructor.Start();

			ThreadPool.QueueUserWorkItem((s) =>
			{
				this.Notifications = new NotificationManager();
				this.EnsureIntegrations();
			});

			return PerformAdditionalHandling;
		}