Can you use Xamarin.Forms 4.0 with Shell and Prism framework

Viewed 2777

Can you use Xamarin Forms 4.0 new Shell with Prism? I'm looking for examples or some documentation

2 Answers

The short answer is sort of and it depends on what from Prism you want to use. You can of course use the ViewModelLocator to inject your ViewModels, but you really don't have a way passing parameters to initialize anything. So none of the Navigation interfaces for example would work, nor would your page get the benefit of the PageBehaviorFactory applying the behaviors that we apply. Ultimately the initial implementation of Shell was completely unusable for every MVVM framework (even if you roll your own).

The Forms team though has been working with us and there is a solution on the horizon. I cannot say when exactly that will land, however in Prism terms if you look at the Shell Support issue, you'll see that it's marked for support in Prism 8.0 which is the current vNext version being worked on.

Also note that the work on this issue has been live streamed on https://twitch.tv/dansiegel and can be viewed for VOD on YouTube https://youtube.com/dansiegel

There is an active issue about this, in Prism Github Page.enter link description here

From one opf the authors:

Technically speaking if all you want is the VML with DI, you can use Prism today with Shell and away you go. Before Prism can properly support Shell we need the Forms team to make some changes as you can see here. Once we're able to properly support Shell we will look at introducing official support for it.

Related