The prism documentation states that there are three region adapters available:
ContentControlRegionAdapter. This adapter adapts controls of type
System.Windows.Controls.ContentControland derived classes.SelectorRegionAdapter. This adapter adapts controls derived from the class
System.Windows.Controls.Primitives.Selector, such as theSystem.Windows.Controls.TabControlcontrol.ItemsControlRegionAdapter. This adapter adapts controls of type
System.Windows.Controls.ItemsControland derived classes.
Unfortunately, Panel does not fall into any of those categories, and I want to be able to write this in my .xaml.cs:
<Canvas cal:RegionManager.RegionName="{x:Static local:RegionNames.MainCanvas}">
How can we accomplish this?
The answer to this can be found in this very nice, descriptive blog post.
However, I want the answer stored on StackOverflow as well 🙂 It took a bit of searching to get this from Google. Here is my code that works with a basic Panel.
Step 1 – create a new region adapter
Step 2 – update your bootstrapper