0
votes

could you help me to understand is it possible make navigation in platform library layer in last MvvmCross version.

My solution has the next structure:

  • Core Layer
  • Library Layer (Android Library)
  • WL (White Lable) Layer (a bunch of android apps)

All my necessary code for android apps placed in Library Layer, in WL layer I just change some resources and images.

Earlier I used MvvmCross 5.1.1 and custom presenter works fine for Me, but in new one MvvmCross 6.1.2 with default presenter doesn't, couldn't find View for ViewModel. If i Move Activity from Library Layer in to any app in WL Layer it works fine.

[MvxActivityPresentation] doesn't work in Libraries project ???

1
Also, new navigation doesn't work with types this.NavigationService.Navigate(typeof(LoginViewModel), hint); just freeze app.Iatsenko Anton
Where do you have your Setup.cs (in your library layer or in your WL)?fmaccaroni

1 Answers

0
votes

In your Setup.cs you need to override your GetViewAssemblies and add the assembly where your Activity is:

public override IEnumerable<Assembly> GetViewAssemblies()
{
    var viewsAssemblies = new List<Assembly>(base.GetViewAssemblies());
    viewsAssemblies.Add(typeof(MyActivity).Assembly);
    return viewsAssemblies;
}

Doing this you ensure that that assembly will be taken into account to find the View corresponding to your ViewModel

More info in Providing additional View and ViewModel Assemblies

HIH