Show / Hide Table of Contents

Class OverlayEffectTriggerBehavior

Behavior for triggering an overlay effect that will exclude the associated element.

Inheritance
object
DispatcherObject
DependencyObject
Freezable
Animatable
Behavior
Behavior<FrameworkElement>
OverlayEffectTriggerBehavior
Implements
IAnimatable
IAttachedObject
Behavior<FrameworkElement>.AssociatedObject
Behavior.CreateInstanceCore()
Behavior.Attach(DependencyObject)
Behavior.Detach()
Behavior.AssociatedType
Animatable.ApplyAnimationClock(DependencyProperty, AnimationClock)
Animatable.ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)
Animatable.BeginAnimation(DependencyProperty, AnimationTimeline)
Animatable.BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)
Animatable.Clone()
Animatable.FreezeCore(bool)
Animatable.GetAnimationBaseValue(DependencyProperty)
Animatable.HasAnimatedProperties
Freezable.CloneCore(Freezable)
Freezable.CloneCurrentValue()
Freezable.CloneCurrentValueCore(Freezable)
Freezable.CreateInstance()
Freezable.Freeze()
Freezable.Freeze(Freezable, bool)
Freezable.GetAsFrozen()
Freezable.GetAsFrozenCore(Freezable)
Freezable.GetCurrentValueAsFrozen()
Freezable.GetCurrentValueAsFrozenCore(Freezable)
Freezable.OnChanged()
Freezable.OnFreezablePropertyChanged(DependencyObject, DependencyObject)
Freezable.OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty)
Freezable.OnPropertyChanged(DependencyPropertyChangedEventArgs)
Freezable.ReadPreamble()
Freezable.WritePostscript()
Freezable.WritePreamble()
Freezable.CanFreeze
Freezable.IsFrozen
Freezable.Changed
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Equals(object)
DependencyObject.GetHashCode()
DependencyObject.GetLocalValueEnumerator()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.InvalidateProperty(DependencyProperty)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, object)
DependencyObject.SetValue(DependencyProperty, object)
DependencyObject.SetValue(DependencyPropertyKey, object)
DependencyObject.ShouldSerializeProperty(DependencyProperty)
DependencyObject.DependencyObjectType
DependencyObject.IsSealed
DispatcherObject.Dispatcher
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Presentation.Controls.Behaviors
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public class OverlayEffectTriggerBehavior : Behavior<FrameworkElement>, IAnimatable, IAttachedObject
Remarks

The overlay will be triggered if IsActive is true and the Microsoft.Xaml.Behaviors.Behavior<T>.AssociatedObject is loaded and visible.

Examples

The following example shows how to enable an overlay effect for all windows from a view and sparing the associated element.

<controls:EditControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                      xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                      IsEnabled="{Binding IsEditing}">
    <b:Interaction.Behaviors>
        <SAF:OverlayEffectTriggerBehavior IsActive="{Binding IsEditing}" />
    </b:Interaction.Behaviors>
</controls:EditControl>

The following example shows how to enable an overlay effect for the source window from a view and sparing the associated element.

<controls:EditControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                      xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                      IsEnabled="{Binding IsEditing}">
    <b:Interaction.Behaviors>
        <SAF:OverlayEffectTriggerBehavior IsActive="{Binding IsEditing}" OverlayType="SourceWindow" />
    </b:Interaction.Behaviors>
</controls:EditControl>

The following example shows how to enable an overlay effect from a view and sparing an additional element.

<controls:EditControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                      xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                      IsEnabled="{Binding IsEditing}">
    <b:Interaction.Behaviors>
        <SAF:OverlayEffectTriggerBehavior IsActive="{Binding IsEditing}" OverlayType="SourceWindow">
            <SAF:ElementReference ElementName="details1" />
        </SAF:OverlayEffectTriggerBehavior>
    </b:Interaction.Behaviors>
</controls:EditControl>

<controls:DetailsControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                         x:Name="details"
                         IsEnabled="{Binding IsEditing}" />

The following example shows how to enable an overlay effect from a view and sparing additional elements.

<controls:EditControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                      xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                      IsEnabled="{Binding IsEditing}">
    <b:Interaction.Behaviors>
        <SAF:OverlayEffectTriggerBehavior IsActive="{Binding IsEditing}" OverlayType="SourceWindow">
            <SAF:ElementReference ElementName="details1" />
            <SAF:ElementReference ElementName="details2" />
        </SAF:OverlayEffectTriggerBehavior>
    </b:Interaction.Behaviors>
</controls:EditControl>

<controls:DetailsControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                         x:Name="details1"
                         IsEnabled="{Binding IsEditing}" />
<controls:DetailsControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                         x:Name="details2"
                         IsEnabled="{Binding IsEditing}" />

The following example shows how a style can manipulate the layout of a control when it is overlaid by an OverlayEffect.

<Style x:Key="DataGridStyle" TargetType="DataGrid">
    <Style.Triggers>
        <Trigger Property="SAF:OverlayEffect.IsOverlayed" Value="True">
            <Setter Property="IsEnabled" Value="False" />
            <Setter Property="CellStyle" Value="{StaticResource OverlayedCellStyle}" />
        </Trigger>
    </Style.Triggers>
</Style>

Constructors

View Source

OverlayEffectTriggerBehavior()

Initializes a new instance of the OverlayEffectTriggerBehavior class.

Declaration
public OverlayEffectTriggerBehavior()

Fields

View Source

AdditionalExcludedElementsProperty

Identifies the DependencyProperty for the AdditionalExcludedElements.

Declaration
public static readonly DependencyProperty AdditionalExcludedElementsProperty
Field Value
Type Description
DependencyProperty
View Source

IsActiveProperty

Identifies the DependencyProperty for IsActive.

Declaration
public static readonly DependencyProperty IsActiveProperty
Field Value
Type Description
DependencyProperty
View Source

OverlayTypeProperty

Identifies the DependencyProperty for OverlayType

Declaration
public static readonly DependencyProperty OverlayTypeProperty
Field Value
Type Description
DependencyProperty

Properties

View Source

AdditionalExcludedElements

Gets the additional excluded elements.

Declaration
public IList AdditionalExcludedElements { get; }
Property Value
Type Description
IList

The additional excluded elements.

Remarks

Use the ElementReference markup extension to provide FrameworkElement references in xaml.

Examples

The following example shows how to enable an overlay effect from a view and sparing additional elements.

<controls:EditControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                      xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                      IsEnabled="{Binding IsEditing}">
    <b:Interaction.Behaviors>
        <SAF:OverlayEffectTriggerBehavior IsActive="{Binding IsEditing}" OverlayType="SourceWindow">
            <SAF:ElementReference ElementName="details1" />
            <SAF:ElementReference ElementName="details2" />
        </SAF:OverlayEffectTriggerBehavior>
    </b:Interaction.Behaviors>
</controls:EditControl>

<controls:DetailsControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                         x:Name="details1"
                         IsEnabled="{Binding IsEditing}" />
<controls:DetailsControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                         x:Name="details2"
                         IsEnabled="{Binding IsEditing}" />
See Also
ElementReference
View Source

IsActive

Gets or sets a value indicating whether the overlay effect is active.

Declaration
public bool IsActive { get; set; }
Property Value
Type Description
bool

true if the overlay effect is active; otherwise, false.

Examples

The following example shows how to enable an overlay effect by binding IsActive to a value in the view model.

<controls:EditControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                      xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                      IsEnabled="{Binding IsEditing}">
    <b:Interaction.Behaviors>
        <SAF:OverlayEffectTriggerBehavior IsActive="{Binding IsEditing}" />
    </b:Interaction.Behaviors>
</controls:EditControl>
View Source

OverlayType

Gets or sets the type of the overlay.

Declaration
public OverlayType OverlayType { get; set; }
Property Value
Type Description
OverlayType

The type of the overlay.

Examples

The following example shows how to set OverlayType to SourceWindow to apply the overlay effect to the source window only.

<controls:EditControl xmlns:controls="clr-namespace:Sartorius.SAF.Documentation.Examples.Effects.Controls"
                      xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                      IsEnabled="{Binding IsEditing}">
    <b:Interaction.Behaviors>
        <SAF:OverlayEffectTriggerBehavior IsActive="{Binding IsEditing}" OverlayType="SourceWindow" />
    </b:Interaction.Behaviors>
</controls:EditControl>
See Also
OverlayType

Methods

View Source

OnAttached()

Called after the behavior is attached to an AssociatedObject.

Declaration
protected override void OnAttached()
Overrides
Microsoft.Xaml.Behaviors.Behavior.OnAttached()
Remarks

Override this to hook up functionality to the AssociatedObject.

View Source

OnDetaching()

Called when the behavior is being detached from its AssociatedObject, but before it has actually occurred.

Declaration
protected override void OnDetaching()
Overrides
Microsoft.Xaml.Behaviors.Behavior.OnDetaching()
Remarks

Override this to unhook functionality from the AssociatedObject.

Implements

IAnimatable
Microsoft.Xaml.Behaviors.IAttachedObject

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
DependencyObjectExtensions.XamlClone<T>(T)
DependencyObjectExtensions.FindAncestor<T>(DependencyObject)
DependencyObjectExtensions.FindFirstChildByType<T>(DependencyObject)
DependencyObjectExtensions.FindLogicalAncestor<T>(DependencyObject)
DependencyObjectExtensions.GetChildrenByType<T>(DependencyObject)
DependencyObjectExtensions.GetContainer(DependencyObject)
DependencyObjectExtensions.SetContainer(DependencyObject, CompositionContainer)

See Also

Behavior<T>
IOverlayEffect
  • View Source
Back to top Generated by DocFX