Show / Hide Table of Contents

Class RegionManager

This class is responsible for maintaining a collection of regions and attaching regions to controls.

Inheritance
System.Object
RegionManager
MefRegionManager
Implements
IRegionManager
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Presentation.Regions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class RegionManager : IRegionManager
Remarks

This class supplies the attached properties that can be used for simple region creation from XAML.

Constructors

View Source

RegionManager()

Initializes a new instance of RegionManager.

Declaration
public RegionManager()

Fields

View Source

RegionContextProperty

Identifies the RegionContext attached property.

Declaration
public static readonly DependencyProperty RegionContextProperty
Field Value
Type Description
System.Windows.DependencyProperty
View Source

RegionManagerProperty

Identifies the RegionManager attached property.

Declaration
public static readonly DependencyProperty RegionManagerProperty
Field Value
Type Description
System.Windows.DependencyProperty
Remarks

When a control has both the RegionNameProperty and RegionManagerProperty attached properties set to a value different than null 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.

View Source

RegionNameProperty

Identifies the RegionName attached property.

Declaration
public static readonly DependencyProperty RegionNameProperty
Field Value
Type Description
System.Windows.DependencyProperty
Remarks

When a control has both the RegionNameProperty and RegionManagerProperty attached properties set to a value different than null 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.

Properties

View Source

Regions

Gets a collection of IRegion that identify each region by name. You can use this collection to add or remove regions to the current region manager.

Declaration
public IRegionCollection Regions { get; }
Property Value
Type Description
IRegionCollection

A IRegionCollection with all the registered regions.

Methods

View Source

CreateRegionManager()

Creates a new region manager.

Declaration
public IRegionManager CreateRegionManager()
Returns
Type Description
IRegionManager

A new region manager that can be used as a different scope from the current region manager.

View Source

GetObservableRegion(DependencyObject)

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 PropertyChanged event to get notified of that change.

Declaration
public static ObservableObject<IRegion> GetObservableRegion(DependencyObject view)
Parameters
Type Name Description
System.Windows.DependencyObject view

The view that will host the region.

Returns
Type Description
ObservableObject<IRegion>

Wrapper that can hold an IRegion value and can notify when the IRegion value changes.

View Source

GetRegionContext(DependencyObject)

Gets the value of the RegionContextProperty attached property.

Declaration
public static object GetRegionContext(DependencyObject target)
Parameters
Type Name Description
System.Windows.DependencyObject target

The target element.

Returns
Type Description
System.Object

The region context to pass to the contained views.

View Source

GetRegionManager(DependencyObject)

Gets the value of the RegionNameProperty attached property.

Declaration
public static IRegionManager GetRegionManager(DependencyObject target)
Parameters
Type Name Description
System.Windows.DependencyObject target

The target element.

Returns
Type Description
IRegionManager

The IRegionManager attached to the target element.

View Source

GetRegionName(DependencyObject)

Gets the value for the RegionNameProperty attached property.

Declaration
public static string GetRegionName(DependencyObject regionTarget)
Parameters
Type Name Description
System.Windows.DependencyObject regionTarget

The object to adapt. This is typically a container (i.e a control).

Returns
Type Description
System.String

The name of the region that should be created when RegionManagerProperty is also set in this element.

View Source

SetRegionContext(DependencyObject, Object)

Sets the RegionContextProperty attached property.

Declaration
public static void SetRegionContext(DependencyObject target, object value)
Parameters
Type Name Description
System.Windows.DependencyObject target

The target element.

System.Object value

The value.

View Source

SetRegionManager(DependencyObject, IRegionManager)

Sets the RegionManagerProperty attached property.

Declaration
public static void SetRegionManager(DependencyObject target, IRegionManager value)
Parameters
Type Name Description
System.Windows.DependencyObject target

The target element.

IRegionManager value

The value.

View Source

SetRegionName(DependencyObject, String)

Sets the RegionNameProperty attached property.

Declaration
public static void SetRegionName(DependencyObject regionTarget, string regionName)
Parameters
Type Name Description
System.Windows.DependencyObject regionTarget

The object to adapt. This is typically a container (i.e a control).

System.String regionName

The name of the region to register.

View Source

UpdateRegions()

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

Declaration
public static void UpdateRegions()
Remarks

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

Events

View Source

UpdatingRegions

Notification used by attached behaviors to update the region managers appropriatelly if needed to.

Declaration
public static event EventHandler UpdatingRegions
Event Type
Type Description
System.EventHandler
Remarks

This event uses weak references to the event handler to prevent this static event of keeping the target element longer than expected. For security reasons, to use weak delegates in Silverlight you must provide a delegate that is available in the public API of the class (no private or anonymous delegates allowed).

Implements

IRegionManager

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
RegionManagerExtensions.RegisterViewWithRegion(IRegionManager, String, Type)
RegionManagerExtensions.RegisterViewWithRegion(IRegionManager, String, Func<Object>)
RegionManagerExtensions.RegisterViewWithRegion<TView, TViewModel>(IRegionManager, String)
RegionManagerExtensions.RequestNavigate(IRegionManager, String, Uri, Action<NavigationResult>)
RegionManagerExtensions.RequestNavigate<T>(IRegionManager, String)
RegionManagerExtensions.RequestNavigate<T>(IRegionManager, String, Action<NavigationResult>)
RegionManagerExtensions.RequestNavigate(IRegionManager, String, Uri)
RegionManagerExtensions.RequestNavigate(IRegionManager, String, String, Action<NavigationResult>)
RegionManagerExtensions.RequestNavigate(IRegionManager, String, String)
RegionManagerExtensions.AttachNewRegion(IRegionManager, DependencyObject, String)
  • View Source
Back to top Generated by DocFX