Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Prism 4.2 and passing parameter objects and navigationcontentloader

$
0
0
Word of warning up front. I haven't actually ran the 4.2 build I was just looking at the code to see how passing the parameter objects would work. So maybe I'm wrong on my assumptions of what the code is doing.

With that out of the way it seems that Prism will be overriding the object stored in the region.Context with the navigation parameters. From the NavigationWithParametersExtensions.RequestNavigate method.

Right now we use the region.Context as kind of like a viewbag to store data we want views to share. This would break that.

For a different way you can check this http://stackoverflow.com/a/20170410/1798889. It is my code and only works with Unity but there is a UnityRegionNavigationContentLoader so it's not unheard of to do specific Unity implementations. I've refactor the code and would be willing to contribute the latest code.

As far as the UnityRegionNavigationContentLoader I've implemented almost the exact same code in Prism 4 but I ended up having to cache the results because Unity Registrations enumeration will recreate the registrations each time, making multiple calls very slow. The first call we query unity registration and get a list of everything that is register to typeof object and then just that list instead of querying the registration because of performance.

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>