Created
March 25, 2019 07:41
-
-
Save leemean/4622e8a9be03dcc72e7cf31e255ccb58 to your computer and use it in GitHub Desktop.
DockingManagerRegionAdapter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DevExpress.Xpf.Docking; | |
using Prism.Regions; | |
namespace APS.RegionAdapters | |
{ | |
/// <summary> | |
/// The region adapter for the DockLayoutManager. | |
/// </summary> | |
public class DockingManagerRegionAdapter : RegionAdapterBase<DockLayoutManager> | |
{ | |
public DockingManagerRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory) | |
: base(regionBehaviorFactory) | |
{ | |
} | |
/// <summary> | |
/// Implementation required by <see cref="RegionAdapterBase"/>. | |
/// </summary> | |
/// <returns>Returns the <see cref="IRegion"/></returns> | |
protected override IRegion CreateRegion() | |
{ | |
return new Region(); | |
} | |
/// <summary> | |
/// Implementation required by <see cref="RegionAdapterBase"/>. | |
/// </summary> | |
/// <param name="region">The <see cref="IRegion"/></param> | |
/// <param name="regionTarget">The <see cref="DockingManager"/></param> | |
protected override void Adapt(IRegion region, DockLayoutManager regionTarget) | |
{ | |
} | |
/// <summary> | |
/// Attaches behavioural objects to the regions behaviours collection. | |
/// </summary> | |
/// <param name="region">The <see cref="IRegion"/></param> | |
/// <param name="regionTarget">The <see cref="DockingManager"/></param> | |
protected override void AttachBehaviors(IRegion region, DockLayoutManager regionTarget) | |
{ | |
if (region == null) | |
{ | |
throw new System.ArgumentNullException("region"); | |
} | |
region.Behaviors.Add(DockingManagerBehavior.BehaviorKey, | |
new DockingManagerBehavior() | |
{ | |
HostControl = regionTarget | |
}); | |
base.AttachBehaviors(region, regionTarget); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment