public MainTabBarController() { UIViewController ProfilesTab, CategoriesTab, ImagesTab, SessionScreen, ImageStackAddingScreen; ProfilesTab = new ProfilesSplitViewController(); CategoriesTab = new CategoriesSplitViewController(); ImagesTab = new AttributesSplitViewController(); SessionScreen = new NewSessionSplitViewController(); ImageStackAddingScreen = new ImageStackAddingSplitViewController(); ProfilesTab.TabBarItem = new UITabBarItem("", UIImage.FromFile("Profiles Icon.png"), 0); ProfilesTab.Title = "Profiles"; ProfilesTab.View.BackgroundColor = AppColors.LIGHT_TEAL; CategoriesTab.TabBarItem = new UITabBarItem("", UIImage.FromFile("Categories Icon.png"), 0); CategoriesTab.Title = "Categories"; CategoriesTab.View.BackgroundColor = AppColors.LIGHT_TEAL; ImagesTab.TabBarItem = new UITabBarItem("", UIImage.FromFile("Images Icon.png"), 0); ImagesTab.Title = "Images"; ImagesTab.View.BackgroundColor = AppColors.LIGHT_TEAL; SessionScreen.TabBarItem.Enabled = false; ImageStackAddingScreen.TabBarItem.Enabled = false; var tabs = new UIViewController[] { ImageStackAddingScreen, ProfilesTab, CategoriesTab, ImagesTab, SessionScreen }; ViewControllers = tabs; SelectedViewController = ProfilesTab; this.TabBar.BarTintColor = AppColors.DARK_GRAY; this.TabBar.SelectedImageTintColor = UIColor.White; UITextAttributes attr = new UITextAttributes(); attr.TextColor = UIColor.White; ProfilesTab.TabBarItem.SetTitleTextAttributes(attr, UIControlState.Normal); CategoriesTab.TabBarItem.SetTitleTextAttributes(attr, UIControlState.Normal); ImagesTab.TabBarItem.SetTitleTextAttributes(attr, UIControlState.Normal); }
void CollectionViewAddButton_TouchUpInside(object sender, EventArgs e) { //new UIAlertView("CollectionView Add Button", "", null, "OK", null).Show(); //show all the images to choose from. create delegate to return those images MainTabBarController tab = (MainTabBarController)ParentViewController; ImageStackAddingSplitViewController imageStackAdding = (ImageStackAddingSplitViewController)tab.CustomizableViewControllers[0]; if (SelectedImageStack != null) { imageStackAdding.SetSelectedImageStack(SelectedImageStack); //imageStackAddingSplitViewController = (ImageStackAddingSplitViewController)tab.ViewControllers[4]; //SessionScreen.setFieldsAndInitialize(sessionsTableViewController.TableView.Source, profileRow, tab); tab.SelectedIndex = 0; tab.DismissModalViewController(true); } else { new UIAlertView("Select an imageStack", "", null, "OK", null).Show(); } }