Answering to my own question, might help someone in the future - partial views are initialized with same parameters as parent view model.
Passing parameters to partial view with Prism
Hi,
I've started using Prism partial views with their own respective view models for reusability. My question is how can I pass parameters to ctor when partial view is created? EventsAggregator is not suitable as I want to filter events in the partial view depending on parent object.
This is how I declare partial view in XAML, the rest is done automagically by Prism:
<dxn:TabViewItem.Content>
<local:CommentsListView prism:ViewModelLocator.AutowirePartialView="{x:Reference self}"/>
</dxn:TabViewItem.Content>
For example, I've view model called JobViewModel, which contains several partial views like CommentsListViewModel, StockListViewModel etc. When CommentsListViewModel or StockListViewModel is created I need it to know which Job number they belong to so I can only filter events from this Job.
Thanks in advance.