Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

FlyoutNavigationController without navigation

$
0
0

So I want to be able to use the Flyout menu but Im having trouble understanding its function

you are supposed yo passs navigation controles in its view controlles but I don't wish to do this

I explain my case

I just want a view that shows a textbox label and a combo and its options are on the side menu

I just couldn't find an example of the flyout menu without it navigatin to its options

here is my code

public override void ViewDidLoad() { //View = new UniversalView();

        base.ViewDidLoad();

        var navController = base.NavigationController;
        navController.NavigationBarHidden = true;

        // Create the flyout view controller, make it large,
        // and add it as a subview:
        navigation = new FlyoutNavigationController();
        var bounds = UIScreen.MainScreen.Bounds;
        navigation.View.Frame = bounds;
        View.AddSubview(navigation.View);

        var rootElement = new RootElement("Task List");

        var section = new Section("Options");
        section.AddAll(CurrenViewModel.MenuItems.Select(menuItem => new StringElement(menuItem.ToString()) as Element));

        rootElement.Add(section);




        // Create the menu:
        navigation.NavigationRoot = rootElement;


        // Create an array of UINavigationControllers that correspond to your
        // menu items:

        navigation.ViewControllers = 
            Array.ConvertAll(

            CurrenViewModel.MenuItems.ToArray(), title =>new UINavigationController
                (new TaskPageController(navigation, title.Name))
        );

    }

The menu Items come from the ViewModel and when they are selected the ViewModel has the logic to what to do, I am currently porting an existing windows phone and android app that have this behavior but I am stuck on the ios port

:D


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>