Skip to content Skip to sidebar Skip to footer

Mvvmcross Fragments Resolving

I'm using Xamarin with MvvmCross, and have problem with fragments usage. I call ShowViewModel so: public class MainViewModel : MvxViewModel { public override void Start() {

Solution 1:

The issue is in your MvxFragment attribute:

[MvxFragment(typeof(MainMenuViewModel), Resource.Id.navigation_frame)]

The first parameter needs to be the MvxViewModel associated to your Activity that you want to place the menu fragment in. In your case I believe this may be MainViewModel?

Mvvmcross description of MvxFragment attribute:

publicMvxFragmentAttribute(
    Type parentActivityViewModelType, 
    int fragmentContentId, 
    bool addToBackStack = false); 

Post a Comment for "Mvvmcross Fragments Resolving"