public override void ViewDidLoad() { base.ViewDidLoad(); // create a slideout navigation controller with the top navigation controller and the menu view controller NavController = new NavController(); NavController.PushViewController(new IntroPage().CreateViewController(), false); SidebarController = new SidebarNavigation.SidebarController(this, NavController, new SideMenuController()); SidebarController.MenuWidth = 220; SidebarController.ReopenOnRotate = false; }
public override void ViewDidLoad() { base.ViewDidLoad(); var activityController = (ActivityController)Storyboard.InstantiateViewController("ActivityController"); var prayerRequestController = (PrayerRequestController)Storyboard.InstantiateViewController("PrayerRequestController"); var praiseReportController = (PraiseReportController)Storyboard.InstantiateViewController("PraiseReportController"); var groupsController = (GroupsController)Storyboard.InstantiateViewController("GroupsController"); var friendsController = (FriendsController)Storyboard.InstantiateViewController("FriendsController"); var settingsController = (SettingsController)Storyboard.InstantiateViewController("SettingsController"); ActivityButton.TouchUpInside += (o, e) => { if (NavController.TopViewController as ActivityController == null) { var ex = NavController.ViewControllers.OfType <ActivityController>().FirstOrDefault(); if (ex != null) { NavController.PopToViewController(ex, true); } else { NavController.PushViewController(activityController, false); } } SidebarController.CloseMenu(); }; PrayerRequestsButton.TouchUpInside += (o, e) => { if (NavController.TopViewController as PrayerRequestController == null) { var ex = NavController.ViewControllers.OfType <PrayerRequestController>().FirstOrDefault(); if (ex != null) { NavController.PopToViewController(ex, true); } else { NavController.PushViewController(prayerRequestController, false); } } SidebarController.CloseMenu(); }; PraiseReportsButton.TouchUpInside += (o, e) => { if (NavController.TopViewController as PraiseReportController == null) { var ex = NavController.ViewControllers.OfType <PraiseReportController>().FirstOrDefault(); if (ex != null) { NavController.PopToViewController(ex, true); } else { NavController.PushViewController(praiseReportController, false); } } SidebarController.CloseMenu(); }; GroupsButton.TouchUpInside += (o, e) => { if (NavController.TopViewController as GroupsController == null) { var ex = NavController.ViewControllers.OfType <GroupsController>().FirstOrDefault(); if (ex != null) { NavController.PopToViewController(ex, true); } else { NavController.PushViewController(groupsController, false); } } SidebarController.CloseMenu(); }; FriendsButton.TouchUpInside += (o, e) => { if (NavController.TopViewController as FriendsController == null) { var ex = NavController.ViewControllers.OfType <FriendsController>().FirstOrDefault(); if (ex != null) { NavController.PopToViewController(ex, true); } else { NavController.PushViewController(friendsController, false); } } SidebarController.CloseMenu(); }; SettingsButton.TouchUpInside += (o, e) => { if (NavController.TopViewController as SettingsController == null) { var ex = NavController.ViewControllers.OfType <SettingsController>().FirstOrDefault(); if (ex != null) { NavController.PopToViewController(ex, true); } else { NavController.PushViewController(settingsController, false); } } SidebarController.CloseMenu(); }; }
//public async override void ViewWillAppear(bool animated) { // base.ViewWillAppear(animated); // if (await WaitDataUserAsync() == true) { // nombreMenuLabel.Text = sesion.sesion.nombre_completo; // } //} public override void ViewDidLoad() { base.ViewDidLoad(); //var contentController = (ContentController)Storyboard.InstantiateViewController("ContentController"); //var otherController = (OtherController)Storyboard.InstantiateViewController("OtherController"); //var introController = (IntroController)Storyboard.InstantiateViewController("IntroController"); var estadoCuentaController = (EstadoDeCuentaTableViewController)Storyboard.InstantiateViewController("EstadoDeCuentaTableViewController"); var historialEstadoCuenta = (HistorialEstadoCuentaTableViewController)Storyboard.InstantiateViewController("HistorialEstadoCuentaTableViewController"); var payReference = (PayRefrenceTableViewController)Storyboard.InstantiateViewController("PayRefrenceTableViewController"); var amortizacion = (AmortizacionTableViewController)Storyboard.InstantiateViewController("AmortizacionTableViewController"); var movimientos = (MovimientosTableViewController)Storyboard.InstantiateViewController("MovimientosTableViewController"); var notify = (SwiperTableViewController)Storyboard.InstantiateViewController("SwiperTableViewController"); var garantias = (GarantiasTableViewController)Storyboard.InstantiateViewController("GarantiasTableViewController"); //nombreMenuLabel.Text = sesion.sesion.nombre_completo; //ContentButton.TouchUpInside += (o, e) => { // if (NavController.TopViewController != estadoCuentaController) { // NavController.PopViewController(true); // //SidebarController.CloseMenu(); // } // Console.WriteLine(NavController.TopViewController.ToString()); // if (NavController.TopViewController as ContentController == null) { // Console.WriteLine("Content Controller == null"); // Console.WriteLine(NavController.TopViewController.ToString()); // NavController.PushViewController(contentController, true); // } else { // SidebarController.CloseMenu(); // } // SidebarController.CloseMenu(); //}; //OtherViewButton.TouchUpInside += (sender, e) => { // if (NavController.TopViewController != estadoCuentaController) { // NavController.PopViewController(true); // //SidebarController.CloseMenu(); // } // Console.WriteLine(NavController.TopViewController.ToString()); // if (NavController.TopViewController as OtherController == null) {//if (NavController.TopViewController as OtherController == null) // Console.WriteLine("Other Controller == null"); // Console.WriteLine(NavController.TopViewController.ToString()); // NavController.PushViewController(otherController, true); // } else { // SidebarController.CloseMenu(); // } // //if (NavController.TopViewController as OtherController == null) { // // //NavController.PushViewController(introController, false); // // NavController.PushViewController(otherController, false); // //} // SidebarController.CloseMenu(); //}; HistorialViewButton.TouchUpInside += (sender, e) => { if (NavController.TopViewController != estadoCuentaController) { NavController.PopViewController(true); //SidebarController.CloseMenu(); } Console.WriteLine(NavController.TopViewController.ToString()); if (NavController.TopViewController as HistorialEstadoCuentaTableViewController == null) // (NavController.TopViewController as OtherController == null) { Console.WriteLine("Other Controller == null"); Console.WriteLine(NavController.TopViewController.ToString()); NavController.PushViewController(historialEstadoCuenta, true); } else { SidebarController.CloseMenu(); } //if (NavController.TopViewController as OtherController == null) { // //NavController.PushViewController(introController, false); // NavController.PushViewController(otherController, false); //} SidebarController.CloseMenu(); }; ReferenciaPagoViewButton.TouchUpInside += (sender, e) => { if (NavController.TopViewController != estadoCuentaController) { NavController.PopViewController(true); //SidebarController.CloseMenu(); } Console.WriteLine(NavController.TopViewController.ToString()); if (NavController.TopViewController as PayRefrenceTableViewController == null) //NavController.TopViewController as OtherController == null (Sentencia Anterior Posible Error) { Console.WriteLine("Other Controller == null"); Console.WriteLine(NavController.TopViewController.ToString()); NavController.PushViewController(payReference, true); } else { SidebarController.CloseMenu(); } //if (NavController.TopViewController as OtherController == null) { // //NavController.PushViewController(introController, false); // NavController.PushViewController(otherController, false); //} SidebarController.CloseMenu(); }; AmortizacionViewButton.TouchUpInside += (sender, e) => { if (NavController.TopViewController != estadoCuentaController) { NavController.PopViewController(true); //SidebarController.CloseMenu(); } Console.WriteLine(NavController.TopViewController.ToString()); if (NavController.TopViewController as AmortizacionTableViewController == null) { Console.WriteLine("Other Controller == null"); Console.WriteLine(NavController.TopViewController.ToString()); NavController.PushViewController(amortizacion, true); } else { SidebarController.CloseMenu(); } //if (NavController.TopViewController as OtherController == null) { // //NavController.PushViewController(introController, false); // NavController.PushViewController(otherController, false); //} SidebarController.CloseMenu(); }; estadoCuentaViewButton.TouchUpInside += (sender, e) => { if (NavController.TopViewController != estadoCuentaController) { NavController.PopViewController(true); //SidebarController.CloseMenu(); } Console.WriteLine(NavController.TopViewController.ToString()); if (NavController.TopViewController as EstadoDeCuentaTableViewController == null) { Console.WriteLine("Other Controller == null"); Console.WriteLine(NavController.TopViewController.ToString()); NavController.PushViewController(estadoCuentaController, true); } else { SidebarController.CloseMenu(); } //if (NavController.TopViewController as OtherController == null) { // //NavController.PushViewController(introController, false); // NavController.PushViewController(otherController, false); //} SidebarController.CloseMenu(); }; NotificationViewButton.TouchUpInside += (sender, e) => { if (NavController.TopViewController != estadoCuentaController) { NavController.PopViewController(true); //SidebarController.CloseMenu(); } Console.WriteLine(NavController.TopViewController.ToString()); if (NavController.TopViewController as SwiperTableViewController == null) { Console.WriteLine("Other Controller == null"); Console.WriteLine(NavController.TopViewController.ToString()); NavController.PushViewController(notify, true); } else { SidebarController.CloseMenu(); } //if (NavController.TopViewController as OtherController == null) { // //NavController.PushViewController(introController, false); // NavController.PushViewController(otherController, false); //} SidebarController.CloseMenu(); }; garantiasViewButton.TouchUpInside += (sender, e) => { if (NavController.TopViewController != estadoCuentaController) { NavController.PopViewController(true); //SidebarController.CloseMenu(); } Console.WriteLine(NavController.TopViewController.ToString()); if (NavController.TopViewController as GarantiasTableViewController == null) { Console.WriteLine("GarantiasTableViewController == null"); Console.WriteLine(NavController.TopViewController.ToString()); NavController.PushViewController(garantias, true); } else { SidebarController.CloseMenu(); } //if (NavController.TopViewController as OtherController == null) { // //NavController.PushViewController(introController, false); // NavController.PushViewController(otherController, false); //} SidebarController.CloseMenu(); }; closeSessionButton.TouchUpInside += (sender, e) => { var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate; var rootController = new RootViewController(); var loginView = (PrincipalNavViewController)Storyboard.InstantiateViewController("PrincipalNavViewController"); appDelegate.SetRootViewController(loginView, true); }; }
public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.FromRGB(75, 75, 75); var HeaderView = new UIView(new CGRect(0, 0, Width, 63)) { BackgroundColor = UIColor.White }; var menuImage = new UIImageView(new CGRect(10, 20, 30, 30)); menuImage.Image = new UIImage("menu_icon.png"); var title = new UILabel(new CGRect(X_Margin, 15, Width, 40)) { Font = UIFont.SystemFontOfSize(15.0f), TextAlignment = UITextAlignment.Left, TextColor = UIColor.DarkGray, Text = "John Anderson", }; HeaderView.Add(title); //HeaderView.Add (menuImage); arrowIcon = new UIImageView(); arrowIcon.Image = new UIImage("arrow_icon.png"); var conversationsButton = new UIButton(UIButtonType.System); conversationsButton.Frame = new CGRect(0, 63, Width + X_Margin, btnHeight); conversationsButton.SetTitle("Conversations", UIControlState.Normal); conversationsButton.ContentEdgeInsets = new UIEdgeInsets(0, X_Margin, 0, 0); conversationsButton.SetTitleColor(UIColor.White, UIControlState.Normal); conversationsButton.Font = UIFont.BoldSystemFontOfSize(15); conversationsButton.BackgroundColor = UIColor.FromRGB(99, 99, 99); conversationsButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; conversationsButton.TouchUpInside += (sender, e) => { arrowIcon.Frame = new CGRect(Width - 50, conversationsButton.Frame.Y + 15, 25, 25); //SidebarController.ChangeContentView (new TSConversationVC()); NavController.PushViewController(new TSConversationView(), true); SidebarController.CloseMenu(); }; var ContactsButton = new UIButton(UIButtonType.System); ContactsButton.Frame = new CGRect(0, conversationsButton.Frame.Y + conversationsButton.Frame.Height + 5, Width + X_Margin, btnHeight); ContactsButton.SetTitle("Contacts", UIControlState.Normal); ContactsButton.ContentEdgeInsets = new UIEdgeInsets(0, X_Margin, 0, 0); ContactsButton.SetTitleColor(UIColor.White, UIControlState.Normal); ContactsButton.Font = UIFont.BoldSystemFontOfSize(15); ContactsButton.BackgroundColor = UIColor.FromRGB(99, 99, 99); ContactsButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; ContactsButton.TouchUpInside += (sender, e) => { // newsButton.BackgroundColor = UIColor.LightGray; // SidebarController.ChangeContentView (new IntroController ()); }; var settingsButton = new UIButton(UIButtonType.System); settingsButton.Frame = new CGRect(0, ContactsButton.Frame.Y + ContactsButton.Frame.Height + 5, Width + X_Margin, btnHeight); settingsButton.SetTitle("Settings", UIControlState.Normal); settingsButton.BackgroundColor = UIColor.FromRGB(99, 99, 99); settingsButton.ContentEdgeInsets = new UIEdgeInsets(0, X_Margin, 0, 0); settingsButton.SetTitleColor(UIColor.White, UIControlState.Normal); settingsButton.Font = UIFont.BoldSystemFontOfSize(15); settingsButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; arrowIcon.Frame = new CGRect(Width - 50, settingsButton.Frame.Y + 15, 25, 25); settingsButton.TouchUpInside += (sender, e) => { NavController.PopToRootViewController(false); arrowIcon.Frame = new CGRect(Width - 50, settingsButton.Frame.Y + 15, 25, 25); SidebarController.CloseMenu(); }; var reportingButton = new UIButton(UIButtonType.System); reportingButton.Frame = new CGRect(0, settingsButton.Frame.Y + settingsButton.Frame.Height + 5, Width + X_Margin, btnHeight); reportingButton.SetTitle("Reporting", UIControlState.Normal); reportingButton.BackgroundColor = UIColor.FromRGB(99, 99, 99); reportingButton.ContentEdgeInsets = new UIEdgeInsets(0, X_Margin, 0, 0); reportingButton.SetTitleColor(UIColor.White, UIControlState.Normal); reportingButton.Font = UIFont.BoldSystemFontOfSize(15); reportingButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; reportingButton.TouchUpInside += (sender, e) => { //intheaterButton.BackgroundColor = UIColor.LightGray; //SidebarController.ChangeContentView (new IntroController ()); }; var AutoBytleIcon = new UIImageView(new CGRect(30, reportingButton.Frame.Y + reportingButton.Frame.Height + 20, 150, 40)); AutoBytleIcon.Image = new UIImage("autobytle.PNG"); var scroll = new UIScrollView(new CGRect(0, 0, Width, 360)); scroll.ContentSize = new CGSize(Width, 360); View.Add(scroll); scroll.Add(conversationsButton); scroll.Add(ContactsButton); scroll.Add(settingsButton); scroll.Add(arrowIcon); scroll.Add(reportingButton); scroll.Add(HeaderView); scroll.Add(AutoBytleIcon); }