Mvvmcross with Xamarin iOS, is it possible to load the ViewController into the ViewController?

I have an MvxViewController that displays a UITableView. When the user selects the ShowViewModel item, the new view is called and displayed.

My goal is to override this so that the new view appears in the ViewContainer on the same screen. I'm not sure how to do this.

I would use SplitViewController, but I need one TabBar / NavigationBar that stretches the entire screen. SplitViewControllers must be set as RootNavigationController - this means that NavigationBars will appear in only one view.

Mockup of UI

+3


source to share


2 answers


Create a UIView for your new View and add it as a subordinate of the parent ViewContainer



+1


source


The best approach I have found to solve this problem is to create a regional service.

A scope service is simply a class that stores a dictionary.

When you create a UIViewController, you can use a child view controller to present it by registering it with a named area service (eg DetailRegion).

Then, in the UIViewController class you want to represent in this region, somehow define the region in which it wants to be represented; possibly an attribute.



Then you just need to create a custom presenter to resolve the UIViewController for the given region name and take the appropriate action to render the view model.

It may sound confusing, but I've used this model on several projects now and it makes my life so much easier.

Thanks, Tristan

+1


source







All Articles