-
-
Save dalexsoto/1881609 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//most of the non-declared variables here are at the class level - eg window is: | |
// UIWindow window | |
// etc. | |
window = new UIWindow (UIScreen.MainScreen.Bounds); | |
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque; | |
tabBar = new UITabBarController(); | |
MainView = tabBar.View; | |
//make some DialogViewController's - I descend various classes off them | |
summary = new OverviewDialogViewController(); | |
records = new RecordsDialogViewController(); | |
deadlines = new DeadlinesDialogViewController(); | |
export = new ExportDialogViewController(); | |
tabControllers = new UINavigationController[] { | |
new UINavigationController(summary) { | |
TabBarItem = new UITabBarItem("Overview", Resources.Overview, 0) | |
}, | |
new UINavigationController(records) { | |
TabBarItem = new UITabBarItem("Records", Resources.Records, 1) | |
}, | |
new UINavigationController(deadlines) { | |
TabBarItem = new UITabBarItem("Deadlines", Resources.Deadlines, 2) | |
}, | |
new UINavigationController(export) { | |
TabBarItem = new UITabBarItem("Export", Resources.Export, 3) | |
} | |
}; | |
tabBar.SetViewControllers(tabControllers, false); | |
tabBar.ViewControllerSelected += delegate(object sender, UITabBarSelectionEventArgs e) { | |
if (tabBar.SelectedIndex == 0) | |
{ | |
(summary as OverviewDialogViewController).ReloadSummary(null); | |
} | |
}; | |
window.RootViewController = tabBar; | |
window.MakeKeyAndVisible (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment