Slide out menu

Jo.1765Jo.1765 USMember
edited June 2014 in Xamarin.iOS

Hi, i have an existing view controller and im trying to attach a 'slide out menu'. I am using the 'Flyout Navigation' component, i have put the code into the login page so if successful the view controller should contain the slide menu, but nothing appears?

**login page

` public void LoginSuccess()
{
if(this.scheduleTableViewController == null){
this.scheduleTableViewController = new ScheduleTableViewController();
}

        var rootNavigationController = new UINavigationController ();
        rootNavigationController.PushViewController (this.scheduleTableViewController, false);
        UIApplication.SharedApplication.Windows [0].RootViewController = rootNavigationController;
    }

`

**scheduleTableViewController

` public override void ViewDidLoad ()
{
base.ViewDidLoad ();

        if (ConfigurationManager.IsiPhone) {

            // 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))
            );

        } 
    }

`

i have an set of strings to be used in the menu
string[] Tasks = { "Get Xamarin", "Learn C#", "Write Killer App", "Add Platforms", "Profit", "Meet Obama", };

any help would be great.
cheers

Sign In or Register to comment.