Reputation: 1135
I have two screens which are linked to two tab buttons
I would like tab to move to second button when I click Next button. In my view model this is my command for Next Button
Here is my code sample
public IMvxCommand NextCommand
{
get
{
return new MvxCommand(() => ShowViewModel<RecyclerViewModel>());
}
}
Rather than tab moving to next tab second view is opening in full screen.
Screens attached
First screen
Second screen
Screen I am seeing
Upvotes: 0
Views: 310
Reputation: 3559
I this situation i would not use the MvvmCross ViewModel navigation, because to use that you probably have to create a custom presenter.
What you can do is just add a button click in the Activity or Fragment itself and use the following code:
var viewPager = view.FindViewById<ViewPager>(Resource.Id.viewpager);
viewPager.SetCurrentItem(1, true);
Upvotes: 1