I have a ContactView that contains a TabControl. By default there are always three tabs on this tab control. Each tab item would contain a different View.
<Grid x:Name="LayoutRoot" >
<sdk:TabItem Header="Contact" Name="CustomerTabItem">
<sdk:TabItem Header="Calls" Name="Calls">
<sdk:TabItem Header="Info" Name="Info">
Nonetheless all three Views would represent a subset of the Contact Model. And here lies the challenge, the plan is to pass a contact from a collection into this viewmodel so it can be displayed.
Now I could be passing the contact object to the ctor of the Contact Module by utilizing an event aggregator.
But here I am stuck, generally I would apply the view first approach by creating my ContactView like this:
_regionManager.RequestNavigate(Constants.MainRegion, new Uri(Constants.ContactView, UriKind.Relative));
Or the classic way like this:
_regionManager.RegisterViewWithRegion(Constants.MainRegion, () => _container.Resolve<ContactView>());
However how would I pass in there my Contact object if I am utilizing the IoC for resolving it in first place?
But even if I got the contact object passed in, I still need to pass it down further to the three sub views in each tab as shown previously. As you might guess each of the three views has its own ViewModel which might need the contact to be passed in as well.
How would I achieve this, especially since those three views are instantiated automatically as soon as the Contact View is created (in xaml), which doesn't leave me any room to inject in anything.
Many Thanks for your advice,