public override void ViewDidLoad () { base.ViewDidLoad (); var Navegacion = new FlyoutNavigationController { NavigationRoot = new RootElement("Navegacion") { new Section ("Secciones") { new StringElement ("Imagen 1"), new StringElement ("Imagen 2"), new StringElement ("Imagen 3"), new StringElement ("Imagen 4"), } }, ViewControllers = new [] { new UIViewController{ View=new UIImageView{Image = UIImage.FromFile ("Imagen1.jpg")}}, new UIViewController{ View=new UIImageView{Image = UIImage.FromFile ("Imagen2.jpg")}}, new UIViewController{ View=new UIImageView{Image = UIImage.FromFile ("Imagen3.jpg")}}, new UIViewController{ View=new UIImageView{Image = UIImage.FromFile ("Imagen4.jpg")}}, }, }; Navegacion.ToggleMenu(); View.AddSubview(Navegacion.View); }
public TaskPageController(FlyoutNavigationController navigation, string title) : base(null) { Root = new RootElement (title) { new Section { new CheckboxElement (title) } }; NavigationItem.LeftBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Action, delegate { navigation.ToggleMenu (); }); NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Refresh, delegate { if(navigation.IsOpen) navigation.ToggleMenu(); if(navigation.FlyMode == FlyoutNavigationController.FlyoutMode.Top) navigation.FlyMode = FlyoutNavigationController.FlyoutMode.Left; else if(navigation.FlyMode == FlyoutNavigationController.FlyoutMode.Left) navigation.FlyMode = FlyoutNavigationController.FlyoutMode.Right; else navigation.FlyMode = FlyoutNavigationController.FlyoutMode.Top; }); }
public override void ViewDidLoad () { base.ViewDidLoad (); var LateralBar = new FlyoutNavigationController {//this will create a new instance of the FlyoutComponent NavigationRoot = new RootElement("Menu"){ //Here we create the root of the alements new Section("Seccion 1"){//with this code we create Sections new StringElement("Header"), new StringElement("Controller 1"),//With this code we create the elements on the sections new StringElement("Controller 2"), }, new Section("Seccion 2"){ new StringElement("Controller 3"), }, }, ViewControllers = new [] {//here we link Controllers to the elements on the sections new UIViewController{View=new UILabel{ Text = "This is the header" }},// The flyout component needs an initializer, and this initializer always needs to be like this, with a new UIViewController{} new Controller1(),//here we create the instances for the Controllers new Controller2(), new Controller3(), } }; LateralBar.ToggleMenu(); View.AddSubview (LateralBar.View); // Perform any additional setup after loading the view, typically from a nib. }
public TaskPageController (FlyoutNavigationController navigation, string title) : base (null) { Root = new RootElement (title) { new Section { new CheckboxElement (title) } }; NavigationItem.LeftBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Action, delegate { navigation.ToggleMenu (); }); }
public SelectClientPage(FlyoutNavigationController navigation, string title) { menuButton = new UIBarButtonItem ( UIImage.FromFile ("*****@*****.**"), UIBarButtonItemStyle.Plain, (s, e) => { navigation.ToggleMenu(); } ); NavigationItem.LeftBarButtonItem = menuButton; NavigationItem.Title = "A"; }
public PageOne (FlyoutNavigationController navigation, string title) : base(null) { menuButton = new UIBarButtonItem ( UIImage.FromFile ("*****@*****.**"), UIBarButtonItemStyle.Plain, (s, e) => { navigation.ToggleMenu(); } ); NavigationItem.LeftBarButtonItem = menuButton; Root = new RootElement ("Page One") { }; }
public SelectField(String farmName,int farmID,int fieldNumber) : base(UITableViewStyle.Grouped, null) { Root = new RootElement (farmName) {}; this.Pushing = true; var fnc = new FlyoutNavigationController() { }; fnc.View.Frame = UIScreen.MainScreen.Bounds; View.AddSubview (fnc.View); // button for slide out fields /* this.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem (UIBarButtonSystemItem.Action, (s,e)=> { fnc.ToggleMenu (); }),true); */ this.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Field", UIBarButtonItemStyle.Plain, (sender,args) => {fnc.ToggleMenu ();}), true); //create the menu var fields = DBConnection.getAllFields(farmID); var menuSection = new Section ("Fields") {}; foreach(Field field in fields){ var fieldID=field.fieldID;//change this var fieldName=field.fieldName;//change this var fieldNameElment=new StringElement(fieldName,()=>{ Selection selection=new Selection(farmName,fieldName,fieldID); this.NavigationController.PushViewController(selection,true); }); menuSection.Add (fieldNameElment); } fnc.NavigationRoot=new RootElement("Fields"){menuSection}; fnc.ViewControllers=new []{ new FieldImage(farmName,farmID,fnc,this), //new UIViewController { View = new UILabel { Text = "Animals (drag right)" } }, }; }
public override void ViewDidLoad() { try { base.ViewDidLoad(); this.Title = "Forum Posts"; View.Frame = UIScreen.MainScreen.Bounds; View.BackgroundColor = UIColor.White; View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; table = new UITableView(new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height)); Action<ForumModel> skaters = new Action<ForumModel>(UpdateAdapter); Forum.PullForumTopics(SettingsMobile.Instance.User.MemberId.ToString(), SettingsMobile.Instance.User.LoginId.ToString(), "league", 0, 0, 0, 30, skaters); // Perform any additional setup after loading the view loading = new LoadingView(); loading.ShowActivity("loading posts"); var group = initialModel.Groups.Where(x => x.GroupId == 0).FirstOrDefault(); if (group != null) initialArray.AddRange(group.Topics); source = new ForumTableView(initialArray, initialModel.ForumId, this.NavigationController); table.Source = source; table.RowHeight = 50; this.NavigationItem.BackBarButtonItem = new UIBarButtonItem(); this.NavigationItem.BackBarButtonItem.Title = "Topics"; //View.Add(table); navigation = new FlyoutNavigationController(UITableViewStyle.Plain); navigation.View.Frame = new RectangleF(0, 60, View.Bounds.Width, View.Bounds.Height); navigation.ViewControllers = new[] { new UIViewController { View = table }, }; View.AddSubview(navigation.View); var button1 = new UIBarButtonItem("Gs", UIBarButtonItemStyle.Plain, (sender, args) => { navigation.ToggleMenu(); }); var button2 = new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, args) => { AddForumTopicViewController add = new AddForumTopicViewController(initialModel.GroupId, initialModel.ForumId, currentGroupName); this.NavigationController.PushViewController(add, true); }); this.NavigationItem.SetRightBarButtonItems(new UIBarButtonItem[] { button1, button2 }, false); Action selected = new Action(SelectedNavigationItem); navigation.SelectedIndexChanged = selected; } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.iPhone); } }