C# Class Microsoft.Practices.Prism.Regions.RegionManager

This class is responsible for maintaining a collection of regions and attaching regions to controls.
This class supplies the attached properties that can be used for simple region creation from XAML.
Inheritance: IRegionManager
Show file Open project: xperiandri/PortablePrism Class Usage Examples

Public Properties

Property Type Description
RegionContextProperty DependencyProperty
RegionManagerProperty DependencyProperty
RegionNameProperty DependencyProperty

Public Methods

Method Description
CreateRegionManager ( ) : IRegionManager

Creates a new region manager.

GetObservableRegion ( DependencyObject view ) : ObservableObject

Returns an ObservableObject{T} wrapper that can hold an IRegion. Using this wrapper you can detect when an IRegion has been created by the RegionAdapterBase{T}. If the ObservableObject{T} wrapper does not yet exist, a new wrapper will be created. When the region gets created and assigned to the wrapper, you can use the ObservableObject{T}.PropertyChanged event to get notified of that change.

GetRegionContext ( DependencyObject target ) : object

Gets the value of the RegionContextProperty attached property.

GetRegionManager ( DependencyObject target ) : IRegionManager

Gets the value of the RegionNameProperty attached property.

GetRegionName ( DependencyObject regionTarget ) : string

Gets the value for the RegionNameProperty attached property.

RegionManager ( ) : System

Initializes a new instance of RegionManager.

SetRegionContext ( DependencyObject target, object value ) : void

Sets the RegionContextProperty attached property.

SetRegionManager ( DependencyObject target, IRegionManager value ) : void

Sets the RegionManagerProperty attached property.

SetRegionName ( DependencyObject regionTarget, string regionName ) : void

Sets the RegionNameProperty attached property.

UpdateRegions ( ) : void

Notifies attached behaviors to update the region managers appropriatelly if needed to.

This method is normally called internally, and there is usually no need to call this from user code.

Private Methods

Method Description
CreateRegion ( DependencyObject element ) : void
IsInDesignMode ( DependencyObject element ) : bool
OnRegionContextChanged ( DependencyObject depObj, DependencyPropertyChangedEventArgs e ) : void
OnSetRegionNameCallback ( DependencyObject element, DependencyPropertyChangedEventArgs args ) : void

Method Details

CreateRegionManager() public method

Creates a new region manager.
public CreateRegionManager ( ) : IRegionManager
return IRegionManager

GetObservableRegion() public static method

Returns an ObservableObject{T} wrapper that can hold an IRegion. Using this wrapper you can detect when an IRegion has been created by the RegionAdapterBase{T}. If the ObservableObject{T} wrapper does not yet exist, a new wrapper will be created. When the region gets created and assigned to the wrapper, you can use the ObservableObject{T}.PropertyChanged event to get notified of that change.
public static GetObservableRegion ( DependencyObject view ) : ObservableObject
view DependencyObject The view that will host the region.
return ObservableObject

GetRegionContext() public static method

Gets the value of the RegionContextProperty attached property.
public static GetRegionContext ( DependencyObject target ) : object
target DependencyObject The target element.
return object

GetRegionManager() public static method

Gets the value of the RegionNameProperty attached property.
public static GetRegionManager ( DependencyObject target ) : IRegionManager
target DependencyObject The target element.
return IRegionManager

GetRegionName() public static method

Gets the value for the RegionNameProperty attached property.
public static GetRegionName ( DependencyObject regionTarget ) : string
regionTarget DependencyObject The object to adapt. This is typically a container (i.e a control).
return string

RegionManager() public method

Initializes a new instance of RegionManager.
public RegionManager ( ) : System
return System

SetRegionContext() public static method

Sets the RegionContextProperty attached property.
public static SetRegionContext ( DependencyObject target, object value ) : void
target DependencyObject The target element.
value object The value.
return void

SetRegionManager() public static method

Sets the RegionManagerProperty attached property.
public static SetRegionManager ( DependencyObject target, IRegionManager value ) : void
target DependencyObject The target element.
value IRegionManager The value.
return void

SetRegionName() public static method

Sets the RegionNameProperty attached property.
public static SetRegionName ( DependencyObject regionTarget, string regionName ) : void
regionTarget DependencyObject The object to adapt. This is typically a container (i.e a control).
regionName string The name of the region to register.
return void

UpdateRegions() public static method

Notifies attached behaviors to update the region managers appropriatelly if needed to.
This method is normally called internally, and there is usually no need to call this from user code.
public static UpdateRegions ( ) : void
return void

Property Details

RegionContextProperty public static property

Identifies the RegionContext attached property.
public static DependencyProperty RegionContextProperty
return DependencyProperty

RegionManagerProperty public static property

Identifies the RegionManager attached property.
When a control has both the RegionNameProperty and RegionManagerProperty attached properties set to a value different than and there is a IRegionAdapter mapping registered for the control, it will create and adapt a new region for that control, and register it in the IRegionManager with the specified region name.
public static DependencyProperty RegionManagerProperty
return DependencyProperty

RegionNameProperty public static property

Identifies the RegionName attached property.
When a control has both the RegionNameProperty and RegionManagerProperty attached properties set to a value different than and there is a IRegionAdapter mapping registered for the control, it will create and adapt a new region for that control, and register it in the IRegionManager with the specified region name.
public static DependencyProperty RegionNameProperty
return DependencyProperty