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 override void ViewDidLoad() { base.ViewDidLoad(); if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { NavigationBar.Frame = new RectangleF(NavigationBar.Frame.X, NavigationBar.Frame.Y, NavigationBar.Frame.Width, 64.0f); } var item = new UINavigationItem(this.title); UIBarButtonItem button = new UIBarButtonItem(MainViewController.ResizedImageIcon(UIImage.FromFile("menu.png")), UIBarButtonItemStyle.Bordered, delegate { navigation.ToggleMenu(); }); item.LeftBarButtonItem = button; item.HidesBackButton = true; NavigationBar.PushNavigationItem(item, false); }
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 override void ViewDidLoad() { base.ViewDidLoad(); stationsRepository = new WebStationRepository(); var centerPoint = Station.TroncalRouteCenter; var centerCoordinate = new CLLocationCoordinate2D(centerPoint.Y, centerPoint.X); var bounds = UIScreen.MainScreen.Bounds; CameraPosition cameraPosition = CameraPosition.FromCamera(centerCoordinate, 14.0f); var map = MapView.FromCamera(new RectangleF(0, 64, bounds.Width, bounds.Height - 60), cameraPosition); map.MyLocationEnabled = true; map.MapType = MapViewType.Normal; map.Settings.MyLocationButton = true; this.mapView = map; if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { NavigationBar.Frame = new RectangleF(NavigationBar.Frame.X, NavigationBar.Frame.Y, NavigationBar.Frame.Width, 64.0f); } var item = new UINavigationItem("CHART"); UIBarButtonItem button = new UIBarButtonItem(MainViewController.ResizedImageIcon(UIImage.FromFile("menu.png")), UIBarButtonItemStyle.Bordered, delegate { navigation.ToggleMenu(); }); UIBarButtonItem closestStationButton = new UIBarButtonItem("Cercana", UIBarButtonItemStyle.Bordered, delegate { FindClosestStation(); }); item.LeftBarButtonItem = button; item.HidesBackButton = true; item.RightBarButtonItem = closestStationButton; NavigationBar.PushNavigationItem(item, false); notificationView = new GCDiscreetNotificationView("Buscando estaciĆ³n cercana...", true, GCDNPresentationMode.Bottom, mapView); this.View.AddSubview(map); LoadMapInfo(); }
/// <summary> /// Views the did load. /// </summary> /// <summary> /// Called when the View is first loaded /// </summary> public override void ViewDidLoad() { base.ViewDidLoad(); NavigationController.NavigationBarHidden = true; Title = "Home"; this.View = new UIView { BackgroundColor = UIColor.White }; navigation = new FlyoutNavigationController(); View.AddSubview(navigation.View); this.AddChildViewController(navigation); //names of the views shown in the flyout var flyoutMenuElements = new Section(); //views that will be shown when a menu item is selected var flyoutViewControllers = new List <UIViewController>(); var homeViewModel = ViewModel as HomeViewModel; if (homeViewModel != null) { //create the ViewModels foreach (var viewModel in homeViewModel.MenuItems) { var viewModelRequest = new MvxViewModelRequest { ViewModelType = viewModel.ViewModelType }; flyoutViewControllers.Add(CreateMenuItemController(viewModelRequest)); flyoutMenuElements.Add(new StringElement(viewModel.Title)); } navigation.ViewControllers = flyoutViewControllers.ToArray(); //add the menu elements var rootElement = new RootElement("") { flyoutMenuElements }; navigation.NavigationRoot = rootElement; } //Listen to messages to toggle the menu and hide MvvmCrosses navigation bar var messenger = Mvx.Resolve <IMvxMessenger>(); navigationMenuToggleToken = messenger.SubscribeOnMainThread <ToggleFlyoutMenuMessage>(message => navigation.ToggleMenu()); navigationBarHiddenToken = messenger.SubscribeOnMainThread <NavigationBarHiddenMessage>(message => NavigationController.NavigationBarHidden = message.NavigationBarHidden); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Action, (s, e) => _navigation.ToggleMenu()); Title = _title; View.BackgroundColor = UIColor.White; _label = new UILabel { Text = _text, TextAlignment = UITextAlignment.Center, }; View.AddSubview(_label); }