What happened to RegionManager.AttachNewRegion()?

Feb 1, 2009 at 2:57 PM
We had working code with CAL 1.0 and now I'm trying to remediate for CAL 2.0 Drop 10. 

It seems that one of the Region creation methods that we are using, RegionManager.AttachNewRegion(), has been removed.  This was a pretty powerful little method and now there's no guidance in the documentation for a new way to manually assign regions onto existing controls.

I'm trying to figure out a workaround, but so far I haven't got it.  I'd appreciate any advice if someone else has figured this out.

Thanks...
Feb 2, 2009 at 4:49 PM
What is the scenario that you are trying to accomplish with this?
After performing lots of refactoring on the Regions namespace and removed this from the interface, we discussed about backward compatibility, but we couldn't find a scenario where this method would be absolutely necessary, althought we might have missed many.

Would the following code suffice your needs?

RegionManager.SetRegionManager(someControl,regionManager);

RegionManager.SetRegionName(someControl, regionName);


You could also do this from XAML if you needed.

Your feedback will be appreciated,
Julian


Feb 22, 2009 at 4:56 PM
Hi Julian!

I have a scenario when the method RegionManager.AttachNewRegion is necessary. If you like to register a context menu as region then you are not able to use the attached property of the RegionManager. AndreasOlivares shows an example how this can be accomplished: http://www.codeplex.com/CompositeWPF/Thread/View.aspx?ThreadId=34664.

I’m using the same approach in my project www.codeplex.com/CompositeExtensions. I tried to migrate my project to Composite WPF2 but I’m stuck because of this issue. The methods you mentioned doesn’t help to solve this scenario.

jbe
Feb 23, 2009 at 12:47 PM
Hi jbe, I answered in the other thread: http://www.codeplex.com/CompositeWPF/Thread/View.aspx?ThreadId=34664#Post160926

I hope this helps workaround the issue with the ContextMenu. I tried it with the example provided in the other post, and it worked for me.
Let me know how it goes.

Julian Dominguez
http://blogs.southworks.net/jdominguez