Wrapping a view when adding it to a region

Topics: Prism v2 - WPF 3.5
Oct 16, 2009 at 6:49 AM

How can I add plumbing code that will intercept and wrap a view that is added to a specific region? 

I am using the AvalonDock region adapters from CompositeWpfContrib but they only work with DocumentPane and DocableContent. I would like to use ordinary UserControl derived views and add them to a AvalonDock region and somehow have some plumbing code intercept when the view is added to such a region and wrap the view as necessary.

Any ideas how I can go about doing this?

Oct 16, 2009 at 3:12 PM


As you said, the AvalonDock sample for contrib only provides RegionAdapters to enable DocumentPane and DockablePane controls to be Region hosts. If I understand correctly, you want to be able to add UserControls to these regions without having them inherit from DockableContent. Without knowing the capabilities/limitations of the AvalonDock controls, what you should do is create a different RegionAdapter that wraps your user controls as any control that can be placed in the AvalonDock controls and then adds them to the host (DocumentPane or DockablePane).

Please let me know if this helps.

Damian Schenkelman