public override void ViewDidLoad() { base.ViewDidLoad(); sessionHeaderView = SessionHeaderView.Create(); navigationController.NavigationBar.AddSubview(sessionHeaderView); #region Delegate Assignments sessionHeaderView.getAddButton().TouchUpInside += (sender, e) => { //Get Main Tab Controller to pass into new tab = (MainTabBarController)ParentViewController.ParentViewController; SessionScreen = (NewSessionSplitViewController)tab.ViewControllers[4]; SessionScreen.setFieldsAndInitialize(sessionsTableViewController.TableView.Source, profileRow, tab); tab.SelectedIndex = 4; tab.DismissModalViewController(true); //ParentViewController.PresentViewController(SessionScreen, true, null); }; #endregion #region Name Changing sessionHeaderView.getProfileNameTextField().AllTouchEvents += (sender, e) => { sessionHeaderView.getProfileNameTextField().TintColor = UIColor.Blue; }; sessionHeaderView.getProfileNameTextField().AddTarget((sender, e) => { profileRow.FirstName = sessionHeaderView.getProfileNameTextField().Text; new DatabaseContext <Profiles>().Update(profileRow); }, UIControlEvent.EditingChanged); #endregion }
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); }