Class RegionViewRegistry
Defines a registry for the content of the regions used on View Discovery composition.
Implements
Namespace: Sartorius.SAF.Presentation.Regions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class RegionViewRegistry : IRegionViewRegistry
Constructors
View SourceRegionViewRegistry(IServiceLocator)
Creates a new instance of the RegionViewRegistry class.
Declaration
public RegionViewRegistry(IServiceLocator locator)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceLocator | locator | CommonServiceLocator.IServiceLocator used to create the instance of the views from its Type. |
Methods
View SourceCreateInstance(Type)
Creates an instance of a registered view Type.
Declaration
protected virtual object CreateInstance(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | Type of the registered view. |
Returns
| Type | Description |
|---|---|
| object | Instance of the registered view. |
GetContents(string)
Returns the contents registered for a region.
Declaration
public IEnumerable<object> GetContents(string regionName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | regionName | Name of the region which content is being requested. |
Returns
| Type | Description |
|---|---|
| IEnumerable<object> | Collection of contents registered for the region. |
RegisterViewWithRegion(string, Func<object>)
Registers a delegate that can be used to retrieve the content associated with a region name.
Declaration
public void RegisterViewWithRegion(string regionName, Func<object> getContentDelegate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | regionName | Region name to which the |
| Func<object> | getContentDelegate | Delegate used to retrieve the content associated with the |
RegisterViewWithRegion(string, Type)
Registers a content type with a region name.
Declaration
public void RegisterViewWithRegion(string regionName, Type viewType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | regionName | Region name to which the |
| Type | viewType | Content type to be registered for the |
Events
View SourceContentRegistered
Occurs whenever a new view is registered.
Declaration
public event EventHandler<ViewRegisteredEventArgs> ContentRegistered
Event Type
| Type | Description |
|---|---|
| EventHandler<ViewRegisteredEventArgs> |