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 override void ViewDidLoad () { base.ViewDidLoad (); // Create the flyout view controller, make it large, // and add it as a subview: navigation = new FlyoutNavigationController (); navigation.Position = FlyOutNavigationPosition.Left; navigation.View.Frame = UIScreen.MainScreen.Bounds; View.AddSubview (navigation.View); this.AddChildViewController (navigation); // Create the menu: navigation.NavigationRoot = new RootElement ("Task List") { new Section ("Task List") { from page in Tasks select new StringElement (page) as Element } }; // Create an array of UINavigationControllers that correspond to your // menu items: navigation.ViewControllers = Array.ConvertAll (Tasks, title => new UINavigationController (new TaskPageController (navigation, title)) ); }
public override void ViewDidLoad() { base.ViewDidLoad(); navigationMenu = new FlyoutNavigationController(); navigationMenu.Position = FlyOutNavigationPosition.Left; navigationMenu.View.Frame = this.containerView.Frame; this.containerView.AddSubview(navigationMenu.View); this.AddChildViewController(navigationMenu); //foreach (string item in HipConstants.MenuItems) //{ // NavigationItem = item; //} //navigationMenu.NavigationItem navigationMenu.NavigationRoot = new RootElement("Menu") { new Section() { from item in HipConstants.menuItems select new StringElement(item) as Element } }; navigationMenu.ViewControllers = Array.ConvertAll(HipConstants.viewControllers, controller => Storyboard.InstantiateViewController(controller)); }
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(); // Create the flyout view controller, make it large, // and add it as a subview: navigation = new FlyoutNavigationController(); navigation.Position = FlyOutNavigationPosition.Left; navigation.View.Frame = UIScreen.MainScreen.Bounds; View.AddSubview(navigation.View); this.AddChildViewController(navigation); // Create the menu: navigation.NavigationRoot = new RootElement("Task List") { new Section("Task List") { from page in Tasks select new StringElement(page) as Element } }; // Create an array of UINavigationControllers that correspond to your // menu items: navigation.ViewControllers = Array.ConvertAll(Tasks, title => new UINavigationController(new TaskPageController(navigation, title)) ); }
public override void ViewDidLoad() { base.ViewDidLoad(); navigation = new FlyoutNavigationController { // Create the navigation menu NavigationRoot = new RootElement("Navigation") { new Section("CV") { new StringElement("Inicio"), new StringElement("Acerca"), new StringElement("Proyectos moviles"), new StringElement("Proyectos web"), new StringElement("Contacto"), } }, ViewControllers = new UIViewController[] { new Home(), new About(), new ProyectMobile(), new ProyectWeb(), new ContactMe(), }, }; // Show the navigation view //navigation.ToggleMenu (); View.AddSubview(navigation.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 (); }); }
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(); }); }
/// <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(); 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(); var navigationController = new UITabBarController(); _navigation = new FlyoutNavigationController(navigationController); _navigation.SetCurrentViewController(new UINavigationController(new ContentViewController(_navigation, "Hello", "Hello World"))); navigationController.AddChildViewController(new UINavigationController(new ButtonViewController(_navigation) { Title = "Tab1" })); navigationController.AddChildViewController(new UIViewController() { Title = "Tab2" }); navigationController.AddChildViewController(new UIViewController() { Title = "Tab3" }); navigationController.AddChildViewController(new UIViewController() { Title = "Tab4" }); navigationController.AddChildViewController(new UIViewController() { Title = "Tab5" }); navigationController.AddChildViewController(new UIViewController() { Title = "Tab6" }); // Specify navigation position _navigation.Position = FlyOutNavigationPosition.Right; _navigation.View.BackgroundColor = UIColor.GroupTableViewBackgroundColor; _navigation.View.Frame = UIScreen.MainScreen.Bounds; View.AddSubview(_navigation.View); AddChildViewController(_navigation); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); SetAppearance(); FlyoutNavigationController.MenuWidth = 80; navigation = new FlyoutNavigationController { // Create the navigation menu NavigationRoot = new RootElement("Navigation") { new Section("") { new IconElement(Resources.KickstarterIcon, "Kickstarter"), new IconElement(Resources.ActivityIcon, "Activity"), new IconElement(Resources.ProfileIcon, "Profile"), } }, // Supply view controllers corresponding to menu items: ViewControllers = new [] { new UINavigationController(new KickstarterViewController()), new UINavigationController(new ActivityViewController()), new UINavigationController(new ProfileViewController()), }, }; navigation.NavigationRoot.TableView.SeparatorStyle = UITableViewCellSeparatorStyle.DoubleLineEtched; navigation.NavigationRoot.TableView.BackgroundColor = UIColor.Black; navigation.NavigationRoot.TableView.ScrollEnabled = false; // Show the navigation view //navigation.ToggleMenu (); //navigation.SelectedIndex = 2; window.RootViewController = navigation; window.MakeKeyAndVisible(); return(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Create the flyout view controller, make it large, // and add it as a subview: navigation = new FlyoutNavigationController(); navigation.Position = FlyOutNavigationPosition.Left; navigation.View.Frame = UIScreen.MainScreen.Bounds; View.AddSubview(navigation.View); this.AddChildViewController(navigation); var taskList = new Section("Task List"); taskList.AddAll(Tasks.Select(x => new StringElement(x))); // Create the menu: navigation.NavigationRoot = new RootElement("Task List") { taskList, new Section("Extras") { new BooleanElement("Toggle", true), new StringElement("Swipable Table"), new StringElement("Storyboard"), } }; // Create an array of UINavigationControllers that correspond to your // menu items: var viewControllers = Tasks.Select(x => new UINavigationController(new TaskPageController(navigation, x))).ToList(); //Add null for the toggle switch viewControllers.Add(null); viewControllers.Add(new UINavigationController(new SwipableTableView())); //Load from Storyboard var storyboardVc = CreateViewController <MyStoryboardViewController> ("MyStoryBoard", "MyStoryboardViewController"); viewControllers.Add(new UINavigationController(storyboardVc)); navigation.ViewControllers = viewControllers.ToArray(); }
void createNavigationFlyout() { var navigation = new FlyoutNavigationController { //Here are sections definied for the drawer: NavigationRoot = new RootElement("Navigation") { new Section("Pages") { new StringElement("MainPage") } }, //Here are controllers definied for the drawer (in this case navigation controller with one root): ViewControllers = new[] { (MainNavigationController)Storyboard.InstantiateViewController("MainNavigationController") } }; View.AddSubview(navigation.View); }
public override void ViewDidLoad() { base.ViewDidLoad(); var navigation = new FlyoutNavigationController() { NavigationRoot = new RootElement("ViveBus") { new Section("Menu") { new StringElement("Mapa"), new StringElement("FAQS"), new StringElement("Acerca de"), } }, }; navigation.ViewControllers = new UIViewController[] { new MapViewController(navigation), new InformationViewController(navigation, "Preguntas Frecuentes", "faqs.json"), new InformationViewController(navigation, "Acerca de", "about.json"), }; navigation.View.Frame = UIScreen.MainScreen.Bounds; navigation.HideShadow = true; navigation.ShouldReceiveTouch += (recognizer, touch) => { if (touch.View.Superview.GetType() == typeof(MapView)) { return(false); } else { return(true); } }; View.AddSubview(navigation.View); navigation.NavigationTableView.AddCSSClass("menu-table"); }
public InformationViewController(FlyoutNavigationController navigation, String title, String filename) { navigationViewController = new NavigationViewController(navigation, title); dialogViewController = new DialogViewController(JsonElement.FromFile(filename)); }
public ButtonViewController(FlyoutNavigationController navigation) { _navigation = navigation; }
public NavigationViewController(FlyoutNavigationController navigation, String title) : base(UserInterfaceIdiomIsPhone ? "NavigationViewController_iPhone" : "NavigationViewController_iPad", null) { this.navigation = navigation; this.title = title; }
public override void LoadView() { View = view = new RootView(); menuItems = new Tuple <Element, UIViewController>[] { new Tuple <Element, UIViewController>(new MenuElement(Strings.Search, "SVG/search.svg", 20) { SaveIndex = false }, new SearchViewController()), new Tuple <Element, UIViewController>(new MenuHeaderElement(Strings.MusicLibraryHeading), null), new Tuple <Element, UIViewController>(new MenuElement(Strings.Artists, "SVG/artist.svg"), new ArtistViewController()), new Tuple <Element, UIViewController>(new MenuElement(Strings.Albums, "SVG/album.svg"), new AlbumViewController()), new Tuple <Element, UIViewController>(new MenuElement(Strings.Genres, "SVG/genres.svg"), new GenreViewController()), new Tuple <Element, UIViewController>(new MenuElement(Strings.Songs, "SVG/songs.svg"), new SongViewController()), new Tuple <Element, UIViewController>(new MenuElement(Strings.Playlists, "SVG/playlists.svg"), new PlaylistViewController()), new Tuple <Element, UIViewController>(new MenuHeaderElement(Strings.Online), null), //new Tuple<Element, UIViewController>(new MenuElement("trending", "SVG/trending.svg"), // new BaseViewController {Title = "Trending", View = {BackgroundColor = UIColor.White}}), new Tuple <Element, UIViewController>(new MenuElement(Strings.Radio, "SVG/radio.svg"), new RadioStationViewController()), new Tuple <Element, UIViewController>(new MenuHeaderElement(Strings.Settings), null), new Tuple <Element, UIViewController>(new MenuSwitch(Strings.OfflineOnly, "SVG/offline.svg", Settings.ShowOfflineOnly) { ValueUpdated = (b) => Settings.ShowOfflineOnly = b }, null), new Tuple <Element, UIViewController>(new MenuSubtextSwitch(Strings.Equalizer , MusicPlayer.Playback.Equalizer.Shared.CurrentPreset?.Name, "SVG/equalizer.svg", Settings.EqualizerEnabled) { ValueUpdated = (b) => MusicPlayer.Playback.Equalizer.Shared.Active = b }, new EqualizerViewController()), new Tuple <Element, UIViewController>(new MenuElement(Strings.Settings, "SVG/settings.svg") { SaveIndex = false }, new SettingViewController()), #if DEBUG || ADHOC new Tuple <Element, UIViewController>(new MenuElement("Console", "SVG/settings.svg") { SaveIndex = false }, new ConsoleViewController()), #endif }; Menu = new FlyoutNavigationController { }; Menu.NavigationRoot = new RootElement("gMusic") { new Section { menuItems.Select(x => x.Item1) } }; Menu.NavigationRoot.TableView.TableFooterView = new UIView(new CGRect(0, 0, 320, NowPlayingViewController.MinVideoHeight)); Menu.NavigationRoot.TableView.BackgroundColor = UIColor.FromPatternImage(UIImage.FromBundle("launchBg")); Menu.NavigationRoot.TableView.BackgroundView = new BluredView(Style.DefaultStyle.NavigationBlurStyle); Menu.NavigationRoot.TableView.SeparatorColor = UIColor.Clear; Menu.NavigationRoot.TableView.EstimatedSectionHeaderHeight = 0; Menu.NavigationRoot.TableView.EstimatedSectionFooterHeight = 0; Menu.ViewControllers = menuItems.Select(x => x.Item2 == null ? null : new UINavigationController(x.Item2)).ToArray(); Menu.HideShadow = false; Menu.ShadowViewColor = UIColor.Gray.ColorWithAlpha(.25f); view.Menu = Menu; Menu.SelectedIndex = Settings.CurrentMenuIndex; AddChildViewController(Menu); NowPlaying = new NowPlayingViewController { Close = () => view.HideNowPlaying(true, true), }; view.NowPlaying = NowPlaying; AddChildViewController(NowPlaying); SetupEvents(); }
public MapViewController(FlyoutNavigationController navigation) : base(UserInterfaceIdiomIsPhone ? "MapViewController_iPhone" : "MapViewController_iPad", null) { this.navigation = navigation; }
public CarHeadView(CarHeadViewController parent) { Parent = parent; this.BackgroundColor = UIColor.FromRGB(64, 64, 64); nowPlayingButton = new UIButton(new CGRect(0, 0, 175, 80)); nowPlayingButton.TintColor = Style.DefaultStyle.AccentColor; nowPlayingButton.SetTitleColor(Style.DefaultStyle.AccentColor, UIControlState.Normal); //nowPlayingButton.TouchUpInside += (sender, e) => ShowNowPlaying (); nowPlayingButton.TitleLabel.TextAlignment = UITextAlignment.Right; nowPlayingButton.TitleLabel.Lines = 2; nowPlayingButton.TitleLabel.LineBreakMode = UILineBreakMode.WordWrap; nowPlayingButton.SetTitle("Now Playing", UIControlState.Normal); //viewControllers = new Dictionary<TabButton, UIViewController> //{ // { radioButton, new CarNavigation(new CarRadioViewController()) }, // { songsButton, new CarNavigation(new CarSongsViewController() )}, // { playlistButton, new CarNavigation(new CarPlaylistViewController()) }, // { artistsButton, new CarNavigation(new CarArtistViewController()) }, //}; var menuItems = new Tuple <Element, UIViewController>[] { new Tuple <Element, UIViewController>(new MenuElement("Artists", "SVG/artist.svg"), new CarArtistViewController()), new Tuple <Element, UIViewController>(new MenuElement("Albums", "SVG/album.svg"), new AlbumViewController()), new Tuple <Element, UIViewController>(new MenuElement("Genres", "SVG/genres.svg"), new CarGenreViewController()), new Tuple <Element, UIViewController>(new MenuElement("Songs", "SVG/songs.svg"), new CarSongsViewController()), new Tuple <Element, UIViewController>(new MenuElement("Playlists", "SVG/playlists.svg"), new CarPlaylistViewController()), new Tuple <Element, UIViewController>(new MenuHeaderElement("online"), null), new Tuple <Element, UIViewController>(new MenuElement("Radio", "SVG/radio.svg"), new CarRadioViewController()), new Tuple <Element, UIViewController>(new MenuHeaderElement("settings"), null), new Tuple <Element, UIViewController>(new MenuSwitch("Offline Only", "SVG/offline.svg", Settings.ShowOfflineOnly) { ValueUpdated = (b) => Settings.ShowOfflineOnly = b }, null), new Tuple <Element, UIViewController>(new MenuSubtextSwitch("Equalizer" , MusicPlayer.Playback.Equalizer.Shared.CurrentPreset?.Name, "SVG/equalizer.svg", Settings.EqualizerEnabled) { ValueUpdated = (b) => MusicPlayer.Playback.Equalizer.Shared.Active = b }, new EqualizerViewController()), }; Menu = new FlyoutNavigationController { }; Menu.NavigationRoot = new RootElement("gMusic") { new Section { menuItems.Select(x => x.Item1) } }; Menu.NavigationRoot.TableView.BackgroundColor = UIColor.FromPatternImage(UIImage.FromBundle("launchBg")); Menu.NavigationRoot.TableView.BackgroundView = new BluredView(UIBlurEffectStyle.Light); Menu.NavigationRoot.TableView.SeparatorColor = UIColor.Clear; Menu.ViewControllers = menuItems.Select(x => x.Item2 == null ? null : new CarNavigation(x.Item2)).ToArray(); Menu.HideShadow = false; Menu.ShadowViewColor = UIColor.Gray.ColorWithAlpha(.25f); Menu.SelectedIndex = 3; AddSubview(Menu.View); parent.AddChildViewController(Menu); }
public ContentViewController(FlyoutNavigationController navigation, string title, string text) { _navigation = navigation; _text = text; _title = title; }
// Overridden from UIViewController public override void ViewDidLoad() { base.ViewDidLoad(); // Create the navigation drawer navigation = new FlyoutNavigationController(); var r = UIScreen.MainScreen.Bounds; r.Y += 20; navigation.View.Frame = r; View.AddSubview(navigation.View); navigation.NavigationTableView.BackgroundColor = new UIColor(Colors.BLACK); navigation.NavigationTableView.AllowsSelection = true; navigation.NavigationRoot = new RootElement("BS Navigation Menu") { new Section(Strings.Navigation.MAIN.ToUpper()) { new IONElement(Strings.Workbench.SELF, UIImage.FromBundle("ic_nav_workbench")), new IONElement(Strings.Analyzer.SELF, UIImage.FromBundle("ic_nav_analyzer")), }, new Section(Strings.Navigation.CALCULATORS.ToUpper()) { new IONElement(Strings.Fluid.PT_CHART, UIImage.FromBundle("ic_nav_pt_chart")), new IONElement(Strings.Fluid.SUPERHEAT_SUBCOOL, UIImage.FromBundle("ic_nav_superheat_subcool")), }, new Section(Strings.Report.REPORTS.ToUpper()) { new IONElement(Strings.Report.MANAGER, UIImage.FromBundle("ic_job_settings")), new IONElement(Strings.Report.LOGGING, UIImage.FromBundle("ic_graph_menu")), new IONElement(Strings.Report.SCREENSHOT_ARCHIVE, OnScreenshotArchiveClicked, UIImage.FromBundle("ic_camera")), new IONElement(Strings.Report.CALIBRATION_CERTIFICATES, OnCalibrationCertificateClicked, UIImage.FromBundle("ic_nav_certificate")), }, new Section("Cloud".ToUpper()) { new IONElement("Appion Portal", UIImage.FromBundle("cloud_menu_icon")), }, new Section(Strings.Navigation.CONFIGURATION.ToUpper()) { new IONElement(Strings.SETTINGS, OnNavSettingsClicked, UIImage.FromBundle("ic_settings")), new IONElement(Strings.HELP, OnHelpClicked, UIImage.FromBundle("ic_help")), }, new Section(Strings.Exit.SHUTDOWN.ToUpper()) { new IONElement(Strings.Exit.SHUTDOWN, OnShutdownClicked, UIImage.FromBundle("ic_nav_power")), } #if DEBUG , new Section("Grid") { new IONElement("GRID", UIImage.FromBundle("ic_nav_power")), } #endif }; var v = new Section(); navigation.ViewControllers = BuildViewControllers(); // Create the menu }