Skip to content

Instantly share code, notes, and snippets.

@dalexsoto
Forked from nicwise/gist:1881577
Created February 22, 2012 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalexsoto/1881609 to your computer and use it in GitHub Desktop.
Save dalexsoto/1881609 to your computer and use it in GitHub Desktop.
//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