Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvx 5.x navigation and TabBarViewController #2137

Closed
1 of 4 tasks
fonix232 opened this issue Aug 23, 2017 · 2 comments
Closed
1 of 4 tasks

Mvx 5.x navigation and TabBarViewController #2137

fonix232 opened this issue Aug 23, 2017 · 2 comments
Assignees
Milestone

Comments

@fonix232
Copy link

In my app, I use an MvxTabBarViewController as the root view of my app, loading three views into it using their ViewModels.

We're rebasing our previous 4.x code to 5.x, and ran into a slight issue regarding this transition with the way the tabs are created.

Currently we have a BaseTabBarView expanding the MvxTabBarViewController with the following function:

protected UIViewController CreateTabFor<Tvm>(string title, string imageName) where Tvm : BaseViewModel
{
    var controller = new UINavigationController();
    var screen = this.CreateViewControllerFor(new MvxViewModelRequest<Tvm>()) as UIViewController;
    SetTitleAndTabBarItem(screen, title, imageName);
    controller.PushViewController(screen, true);
    return screen;
}

This has worked great before, including the subpages' navigation Task Init() method being called. However if I switch to the new NavigationService way of handling stuff, the new Task Initialize() method is never called.

How could I adopt this to the new NavigationService?

Configuration

Version: 5.x

Platform:

  • iOS
  • Android
  • WPF
  • UWP
@nmilcoff
Copy link
Contributor

Are you using the new MvxIosViewPresenter that comes with MvvmCross 5? I recommend you to look at how it is implemented in Playground TestProject. That sample app uses both the new presenter and the new navigation service.

Have you read the documentation pages? That being said, I'll need more details to be able to help you.

@fonix232
Copy link
Author

Yes, we are using the new MvxIosViewPresenter. However our old method was using the N+1 samples, which was still the old navigation pattern. Using the global NavigationService to push these child views solved the issue. Thanks!

@martijn00 martijn00 added this to the 5.2.0 milestone Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants