Closed stefandevo closed 9 years ago
An extra addition could be to look for different pages based upon the fact you are running on a tablet. You can create Pages with extensions Tablet for example.
An idea could be to use Attributes to classify the Page whether it is Tablet or Phone idiom?
Would be nice if this PR could be merged...
@stefandevo i'll merge this now, can you open a new PR to have support for Tablet and phone?
This change allows that ViewModels and Pages are not in the same assembly. Original code was looking for Pages in the same assembly as the requested ViewModel.
The standard behavior has not changed from the Original code; however it is now possible to implement your own
MvxFormsPageLoader
instance with your own logic to "find" the page. You then have to register theIMvxFormsPageLoader
into your IOC container.Example. I have an assembly with the ViewModels (no reference to Xamarin.Forms); another assembly that contains the Pages (references Xamarin.Forms). In the Xamarin.Forms assembly I created a custom PageLoader.
In order to get this page loader inside the IOC container I have to add following code in each platforms Setup.cs:
Of course, the above can be accomplished in the Initialization of the App.cs, but in my case the App.cs has no reference towards Xamarin.Forms (only viewmodels are there).
Comments welcome!