C# Class Microsoft.Practices.Prism.Regions.Behaviors.DelayedRegionCreationBehavior

Behavior that creates a new IRegion, when the control that will host the IRegion (see TargetElement) is added to the VisualTree. This behavior will use the RegionAdapterMappings class to find the right type of adapter to create the region. After the region is created, this behavior will detach.
Attached property value inheritance is not available in Silverlight, so the current approach walks up the visual tree when requesting a region from a region manager. The RegionManagerRegistrationBehavior is now responsible for walking up the Tree.
显示文件 Open project: xperiandri/PortablePrism Class Usage Examples

Public Methods

Method Description
Attach ( ) : void

Start monitoring the RegionManager and the TargetElement to detect when the TargetElement becomes part of the Visual Tree. When that happens, the Region will be created and the behavior will Detach.

DelayedRegionCreationBehavior ( RegionAdapterMappings regionAdapterMappings ) : Microsoft.Practices.Prism.Properties

Initializes a new instance of the DelayedRegionCreationBehavior class.

Detach ( ) : void

Stop monitoring the RegionManager and the TargetElement, so that this behavior can be garbage collected.

Protected Methods

Method Description
CreateRegion ( DependencyObject targetElement, string regionName ) : IRegion

Method that will create the region, by calling the right IRegionAdapter.

Private Methods

Method Description
ElementLoaded ( object sender, RoutedEventArgs e ) : void
OnUpdatingRegions ( object sender, EventArgs e ) : void
TryCreateRegion ( ) : void
UnWireTargetElement ( ) : void
WireUpTargetElement ( ) : void

Method Details

Attach() public method

Start monitoring the RegionManager and the TargetElement to detect when the TargetElement becomes part of the Visual Tree. When that happens, the Region will be created and the behavior will Detach.
public Attach ( ) : void
return void

CreateRegion() protected method

Method that will create the region, by calling the right IRegionAdapter.
protected CreateRegion ( DependencyObject targetElement, string regionName ) : IRegion
targetElement DependencyObject The target element that will host the .
regionName string Name of the region.
return IRegion

DelayedRegionCreationBehavior() public method

Initializes a new instance of the DelayedRegionCreationBehavior class.
public DelayedRegionCreationBehavior ( RegionAdapterMappings regionAdapterMappings ) : Microsoft.Practices.Prism.Properties
regionAdapterMappings RegionAdapterMappings /// The region adapter mappings, that are used to find the correct adapter for /// a given controltype. The controltype is determined by the value. ///
return Microsoft.Practices.Prism.Properties

Detach() public method

Stop monitoring the RegionManager and the TargetElement, so that this behavior can be garbage collected.
public Detach ( ) : void
return void