Using a iOS UITabBar with MVVMCross MvxViewControl

2019-08-09 17:05发布

问题:

We have a 4 views that are considered siblings in the UX design and so we would like to display them on a TabBar in iOS. We already have them in a NavigationDrawer in Android.

Lets call them

  1. Customer
  2. CustomerOrders
  3. CustomerHistory
  4. Returns

These are represented by 4 separate ViewModels. Looking at the MvxTabBarViewController samples I have to created a Uber ViewModel that exposes all 4 ViewModels as properties. Then attach the 4 views (MvxViewControllers) to a Parent View (MvxTabViewController).

UPDATE

I don't want to create a ViewModel just to support iOS' way of doing things. I tried creating a UITabBar as a standalone view but that fails to deal with more than 5 items.

I have given up trying to fight the toolbar and am going to create a iOS specific ViewModel to host the Customer, CustomerOrders, CustomerHistory and Returns ViewModels. That is how the MvxTabViewController wants me to do it so I will. Getting that to work involves some MVVMCross configuration that I think is best handled by a new question. Once created I will link to it from here New question

Any suggestions?