Using UserControl inside a UserControl

Topics: Prism v4 - WPF 4
Nov 10, 2014 at 8:12 PM
Edited Nov 10, 2014 at 8:14 PM

I have the following scenario:



Top region consists of AppMenu user control and I use _regionManager.RegisterViewWithRegion to register the AppMenu. AppMenu has buttons for "Home", "New Sale", "New Order". New Sale is cash sale, New Order is a phone order that gets queued.

MainRegion can contain the following views.

"Home" or "New Sale" or "New Order" views.

"Home" is the main page and I call _regionManager.RequestNavigate to show the main page.

When the user clicks New Order or New Sale button I use _regionManager.RequestNavigate to show the respective view in the main region.

In "New Sale" and "New Order" those views have unique fields that pertain to them. I also have a common product search control that I want to place in them. I am calling this control as "ProductControl"

My issue is how do I inject the ProductControl to show in "New Sale" or "New Order" using Unity as my container?

When I use the regular way of <controls:ProductControl /> unity does not manage the life time. Also, the designer will complain that the control does not have a default constructor.

I am using Prism 5.

Thanks for your time.