This project has moved and is read-only. For the latest updates, please go here.

PRISM and childwindow

Dec 3, 2010 at 11:19 PM

Nice control btw, since we got cheated imo on the wpf side of xaml world..  Down to the question this control being of contentcontrol it can be a region without extra work.  What would you suggest be the best way to attach a usercontrol to it and then call its show method? I am thinking possiblely a pub/sub via EventAggregator.  I have been trying to use the RegionPopupBehavior, but find it very cumbersome to work with.  Your input is greatly appreciated.



Dec 4, 2010 at 1:21 AM

Well I haven't tried this but off the top of my head I would probably not use the UserControl approach.  I might define the ChildWindow control in the Shell or a View (if using ScopedRegions) and give it a region name.  Maybe something similar to:

<ChildWindow cal:RegionManager.RegionName="ChildWindowRegion"....... />
Then have the content injected into the region at runtime from your module.  The Shell/View's ViewModel/Controller could be resposible for show/hiding the window in combination with the event aggregator..