C# 弹出式导航-iOS

C# 弹出式导航-iOS,c#,ios,uiviewcontroller,uinavigationcontroller,xamarin,C#,Ios,Uiviewcontroller,Uinavigationcontroller,Xamarin,我正在尝试使用Clanchey FlyoutNavigation,但是我无法让它执行segue 我希望它像一个导航菜单一样工作,所以如果我按下“开始”,它会转到我故事板上的某个视图 这是我当前的代码,但它根本不起作用 var navigation = new FlyoutNavigationController { // Create the navigation menu NavigationRoot = new RootElem

我正在尝试使用Clanchey FlyoutNavigation,但是我无法让它执行segue

我希望它像一个导航菜单一样工作,所以如果我按下“开始”,它会转到我故事板上的某个视图

这是我当前的代码,但它根本不起作用

var navigation = new FlyoutNavigationController {
                // Create the navigation menu
                NavigationRoot = new RootElement ("Navigation") {
                    new Section ("Pages") {
                        new StringElement ("Start"),
                    }
                },
                // Supply view controllers corresponding to menu items:
                ViewControllers = new [] {
                    new UIViewController { this.PerformSegue("toError", this) },
                },
            };
            // Show the navigation view
            navigation.ToggleMenu ();
            View.AddSubview (navigation.View);

我不知道你在这个问题上是否还需要帮助,因为这个问题是去年提出的,但我所做的是创建一个自定义菜单控制器,它继承了“FlyoutNavigationController”。通过这种方式,添加我想从任何视图导航到的菜单的新实例非常容易。 我对自定义菜单的编码方式如下:

首先,我创建了我希望能够导航到的菜单的新实例:

UINavigationController planningViewController = new UINavigationController(new PlanningViewController());
然后我将它们添加到一个数组中:

UIViewController[] viewcontrollers = new [] { planningViewController };
然后我将它们添加到根元素:

NavigationRoot = new RootElement ("Planning") 
{ 
    new Section ("Menu") 
    {
        new StringElement ("Rooster"),
    },
};
其余的编码是关于添加用于单击菜单元素的代理。我使用一个单独的FlyOutDataSource来处理程序应该引导您到哪个菜单,但是这可以在声明菜单的同一个类中完成。您可以使用单击元素的索引来确定应该导航到哪个菜单