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

Class that creates a fluent interface for the IRegionManager class, with respect to adding views to regions (View Injection pattern), registering view types to regions (View Discovery pattern)
Show file Open project: xperiandri/PortablePrism

Public Methods

Method Description
Add ( this regionCollection, string regionName, IRegion region ) : void

Adds a region to the regionmanager with the name received as argument.

AddToRegion ( this regionManager, string regionName, object view ) : IRegionManager

Add a view to the Views collection of a Region. Note that the region must already exist in this regionmanager.

RegisterViewWithRegion ( this regionManager, string regionName, Func getContentDelegate ) : IRegionManager

Associate a view with a region, using a delegate to resolve a concreate instance of the view. When the region get's displayed, this delelgate will be called and the result will be added to the views collection of the region.

RegisterViewWithRegion ( this regionManager, string regionName, Type viewType ) : IRegionManager

Associate a view with a region, by registering a type. When the region get's displayed this type will be resolved using the ServiceLocator into a concrete instance. The instance will be added to the Views collection of the region

RequestNavigate ( this regionManager, string regionName, Uri source ) : void

Navigates the specified region manager.

RequestNavigate ( this regionManager, string regionName, Uri source, Action navigationCallback ) : void

Navigates the specified region manager.

RequestNavigate ( this regionManager, string regionName, string source ) : void

Navigates the specified region manager.

RequestNavigate ( this regionManager, string regionName, string source, Action navigationCallback ) : void

Navigates the specified region manager.

Method Details

Add() public static method

Adds a region to the regionmanager with the name received as argument.
Thrown if or is . Thrown if and 's name do not match and the is not .
public static Add ( this regionCollection, string regionName, IRegion region ) : void
regionCollection this The regionmanager's collection of regions.
regionName string The name to be given to the region.
region IRegion The region to be added to the regionmanager.
return void

AddToRegion() public static method

Add a view to the Views collection of a Region. Note that the region must already exist in this regionmanager.
public static AddToRegion ( this regionManager, string regionName, object view ) : IRegionManager
regionManager this The regionmanager that this extension method effects.
regionName string The name of the region to add a view to
view object The view to add to the views collection
return IRegionManager

RegisterViewWithRegion() public static method

Associate a view with a region, using a delegate to resolve a concreate instance of the view. When the region get's displayed, this delelgate will be called and the result will be added to the views collection of the region.
public static RegisterViewWithRegion ( this regionManager, string regionName, Func getContentDelegate ) : IRegionManager
regionManager this The regionmanager that this extension method effects.
regionName string The name of the region to associate the view with.
getContentDelegate Func The delegate used to resolve a concreate instance of the view.
return IRegionManager

RegisterViewWithRegion() public static method

Associate a view with a region, by registering a type. When the region get's displayed this type will be resolved using the ServiceLocator into a concrete instance. The instance will be added to the Views collection of the region
public static RegisterViewWithRegion ( this regionManager, string regionName, Type viewType ) : IRegionManager
regionManager this The regionmanager that this extension method effects.
regionName string The name of the region to associate the view with.
viewType System.Type The type of the view to register with the
return IRegionManager

RequestNavigate() public static method

Navigates the specified region manager.
public static RequestNavigate ( this regionManager, string regionName, Uri source ) : void
regionManager this The regionmanager that this extension method effects.
regionName string The name of the region to call Navigate on.
source System.Uri The URI of the content to display.
return void

RequestNavigate() public static method

Navigates the specified region manager.
public static RequestNavigate ( this regionManager, string regionName, Uri source, Action navigationCallback ) : void
regionManager this The regionmanager that this extension method effects.
regionName string The name of the region to call Navigate on.
source System.Uri The URI of the content to display.
navigationCallback Action The navigation callback.
return void

RequestNavigate() public static method

Navigates the specified region manager.
public static RequestNavigate ( this regionManager, string regionName, string source ) : void
regionManager this The regionmanager that this extension method effects.
regionName string The name of the region to call Navigate on.
source string The URI of the content to display.
return void

RequestNavigate() public static method

Navigates the specified region manager.
public static RequestNavigate ( this regionManager, string regionName, string source, Action navigationCallback ) : void
regionManager this The regionmanager that this extension method effects.
regionName string The name of the region to call Navigate on.
source string The URI of the content to display.
navigationCallback Action The navigation callback.
return void