public ListView(FlyoutController navigation, string title, string id, bool bin = false) : base(id, bin) { var fav = new UITabBarItem(UITabBarSystemItem.Contacts, 1); var img = fav.SelectedImage; this.Title = title; navigation.NavigationTableView.SectionHeaderHeight = 0f; NavigationItem.RightBarButtonItem = new UIBarButtonItem(fav.SelectedImage, UIBarButtonItemStyle.Plain, delegate { using (var app = (AppDelegate)UIApplication.SharedApplication.Delegate){ app.ShowSearch(); } }); NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Action, delegate { navigation.ToggleMenu(); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); navigation = new FlyoutController(); navigation.Position = FlyOutNavigationPosition.Left; navigation.View.Frame = UIScreen.MainScreen.Bounds; AddChildViewController(navigation); service.GetResultsAsync().ContinueWith( (task) => InvokeOnMainThread(() => { results = task.Result.Result; View.AddSubview(navigation.View); var searchIds = results.Select(x => x.id).ToArray(); int count = 0; navigation.ViewControllers = Array.ConvertAll( results.Select(x => x.name).ToArray(), title => { var list = new ListView(navigation, title, searchIds[count], false); var nav = new UINavigationController(list); nav.NavigationBarHidden = false; count++; return(nav); } ); LoadBin(); count = 0; over.Hide(); } )); }