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

Region Support for TransitioningContentControl (very simple modification)

Nov 13, 2011 at 11:20 PM

Hi Jeremy,

In RegionManager.cs, I propose to change the test to find the RegionAdapter this way :

private Lazy<IRegionAdapterBase, IRegionAdapterMetadata> _GetRegionAdapterForType(Type targetRegionType)
// CURRENT : return (from r in RegionAdapters where r.Metadata.TargetType.Equals(targetRegionType) select r).FirstOrDefault(); 
  // NEW ONE :
  return (from r in RegionAdapters where r.Metadata.TargetType.IsAssignableFrom(targetRegionType) select r).FirstOrDefault();

This simple modification allows for supporting TransitioningContentControl, thus automatic animation when region content is changed.

Simple fade transition at no cost, and without any code.

But at this time, the way the test is done (Equals) does not allow it. Testing with IsAssignableFrom is a better choice allowing Jounce users to use any custom ContentControl child class.

What do you thing about integrating this modification in next release ?