Class Region
Implementation of IRegion that allows multiple active views.
Inheritance
Namespace: Sartorius.SAF.Presentation.Regions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class Region : IRegion, INavigateAsync, INotifyPropertyChanged
Constructors
View SourceRegion()
Initializes a new instance of Region.
Declaration
public Region()
Properties
View SourceActiveViews
Gets a readonly view of the collection of all the active views in the region.
Declaration
public virtual IViewsCollection ActiveViews { get; }
Property Value
| Type | Description |
|---|---|
| IViewsCollection | An IViewsCollection of all the active views. |
Behaviors
Gets the collection of IRegionBehaviors that can extend the behavior of regions.
Declaration
public IRegionBehaviorCollection Behaviors { get; }
Property Value
| Type | Description |
|---|---|
| IRegionBehaviorCollection |
Context
Gets or sets a context for the region. This value can be used by the user to share context with the views.
Declaration
public object Context { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The context value to be shared. |
ItemMetadataCollection
Gets the collection with all the views along with their metadata.
Declaration
protected virtual ObservableCollection<ItemMetadata> ItemMetadataCollection { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ObservableCollection<ItemMetadata> | An System.Collections.ObjectModel.ObservableCollection<T> of ItemMetadata with all the added views. |
Name
Gets the name of the region that uniquely identifies the region within a IRegionManager.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The name of the region. |
NavigationService
Gets the navigation service.
Declaration
public IRegionNavigationService NavigationService { get; set; }
Property Value
| Type | Description |
|---|---|
| IRegionNavigationService | The navigation service. |
RegionManager
Gets or sets the IRegionManager that will be passed to the views when adding them to the region, unless the view is added by specifying createRegionManagerScope as true.
Declaration
public IRegionManager RegionManager { get; set; }
Property Value
| Type | Description |
|---|---|
| IRegionManager | The IRegionManager where this IRegion is registered. |
Remarks
This is usually used by implementations of IRegionManager and should not be used by the developer explicitely.
SortComparison
Gets or sets the comparison used to sort the views.
Declaration
public Comparison<object> SortComparison { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Comparison<System.Object> | The comparison to use. |
Views
Gets a readonly view of the collection of views in the region.
Declaration
public virtual IViewsCollection Views { get; }
Property Value
| Type | Description |
|---|---|
| IViewsCollection | An IViewsCollection of all the added views. |
Methods
View SourceActivate(Object)
Marks the specified view as active.
Declaration
public virtual void Activate(object view)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | view | The view to activate. |
Add(Object)
Adds a new view to the region.
Declaration
public IRegionManager Add(object view)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | view | The view to add. |
Returns
| Type | Description |
|---|---|
| IRegionManager | The IRegionManager that is set on the view if it is a System.Windows.DependencyObject. It will be the current region manager when using this overload. |
Add(Object, String)
Adds a new view to the region.
Declaration
public IRegionManager Add(object view, string viewName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | view | The view to add. |
| System.String | viewName | The name of the view. This can be used to retrieve it later by calling GetView(String). |
Returns
| Type | Description |
|---|---|
| IRegionManager | The IRegionManager that is set on the view if it is a System.Windows.DependencyObject. It will be the current region manager when using this overload. |
Add(Object, String, Boolean)
Adds a new view to the region.
Declaration
public virtual IRegionManager Add(object view, string viewName, bool createRegionManagerScope)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | view | The view to add. |
| System.String | viewName | The name of the view. This can be used to retrieve it later by calling GetView(String). |
| System.Boolean | createRegionManagerScope | When true, the added view will receive a new instance of IRegionManager, otherwise it will use the current region manager for this region. |
Returns
| Type | Description |
|---|---|
| IRegionManager | The IRegionManager that is set on the view if it is a System.Windows.DependencyObject. |
Deactivate(Object)
Marks the specified view as inactive.
Declaration
public virtual void Deactivate(object view)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | view | The view to deactivate. |
DefaultSortComparison(Object, Object)
The default sort algorithm.
Declaration
public static int DefaultSortComparison(object x, object y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | x | The first view to compare. |
| System.Object | y | The second view to compare. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetView(String)
Returns the view instance that was added to the region using a specific name.
Declaration
public virtual object GetView(string viewName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | viewName | The name used when adding the view to the region. |
Returns
| Type | Description |
|---|---|
| System.Object | Returns the named view or null if the view with |
Remove(Object)
Removes the specified view from the region.
Declaration
public virtual void Remove(object view)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | view | The view to remove. |
RequestNavigate(Uri, Action<NavigationResult>)
Initiates navigation to the specified target.
Declaration
public void RequestNavigate(Uri target, Action<NavigationResult> navigationCallback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | target | The target. |
| System.Action<NavigationResult> | navigationCallback | A callback to execute when the navigation request is completed. |
Events
View SourcePropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type | Description |
|---|---|
| System.ComponentModel.PropertyChangedEventHandler |