Class RegionMemberLifetimeBehavior
The RegionMemberLifetimeBehavior determines if items should be removed from the IRegion when they are deactivated.
Implements
Namespace: Sartorius.SAF.Presentation.Regions.Behaviors
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class RegionMemberLifetimeBehavior : RegionBehavior, IRegionBehavior
Remarks
The RegionMemberLifetimeBehavior monitors the ActiveViews collection to discover items that transition into a deactivated state.
The behavior checks the removed items for either the IRegionMemberLifetime or the RegionMemberLifetimeAttribute (in that order) to determine if it should be kept alive on removal.
If the item in the collection is a FrameworkElement, it will also check it's DataContext for IRegionMemberLifetime or the RegionMemberLifetimeAttribute.
The order of checks are:
- Region Item's IRegionMemberLifetime.KeepAlive value.
- Region Item's DataContext's IRegionMemberLifetime.KeepAlive value.
- Region Item's RegionMemberLifetimeAttribute.KeepAlive value.
- Region Item's DataContext's RegionMemberLifetimeAttribute.KeepAlive value.
Fields
View SourceBehaviorKey
The key for this behavior.
Declaration
public const string BehaviorKey = "RegionMemberLifetimeBehavior"
Field Value
| Type | Description |
|---|---|
| string |
Methods
View SourceOnAttach()
Override this method to perform the logic after the behavior has been attached.
Declaration
protected override void OnAttach()