What david is describing in his blog post unfortunately is not possible with the upcoming release of Prism.
We talked about this quite a lot - Internally and with our advirors - and decided not to implement something like this.
Our initial idea was to be able to do something like this:
<ContentControl RegionName="MyRegion" ViewType="IMyView">
And then also to be able to access interface parameters (like the presenter, or something else) on that interface on the view. However, our advisors were quite strongly opposed to that idea, because it breaks some of the modularity of the system.
Also, specifying the type (or interface) of a view or presenter to load in your view is not easy in silverlight. You have to specify the fully qualified name in a string, because <x:Type IMyViewType> is not supported in Silverlight.
Now, we are supporting ViewDiscovery by registering types against a region name. When a region with that name is displayed, the type of the registered view is created.
What you are describing, createing a view that receives the presenter as a parameter in the constructor is still possible. However, since all the we converted quickstarts from Prism V1 were using the presenter first pattern, we are not demonstrating how
to do what you are describing.
So if you do:
The view will be created with unity and all dependencies that the view has defined in the constructor will be injected.
Now you also mentioned that you wanted to specify the dependencies in XAML. Please correct me if I'm wrong, but the only reason for that I could think of is if you want to display the same view twice, but with a different TYPE of presenter. Usually, I see
it the other way around. Different views using the same presenter to get different representations of the same data & logic.
Now if you really want to specify your dependencies in XAML, it's not impossible, but it requires some serious customization.
1. Create a dependency property for the Region that will host your dependency (for example, a string that will contain the type of the presenter you wish to add)
2. Create a custom regionbehavior that implements IHostAwareRegionBehavior
2.1 This behavior will monitor the Views collection to see if views are added and removed
2.2 Retrieve the dependency property value with the presenter type name from the hostcontrol
2.3 When a view is added, it will create use the presenter typename to create an instance of the presenter and add it to the view. YOu might have to create a common 'IPresenterAware' behavior to allow you to set the presenter on the view.
Hope this helps.