Show / Hide Table of Contents

Class OverlayEffectTriggerBehavior

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

Inheritance
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Freezable
System.Windows.Media.Animation.Animatable
Microsoft.Xaml.Behaviors.Behavior
Microsoft.Xaml.Behaviors.Behavior<System.Windows.FrameworkElement>
OverlayEffectTriggerBehavior
Implements
System.Windows.Media.Animation.IAnimatable
Microsoft.Xaml.Behaviors.IAttachedObject
Microsoft.Xaml.Behaviors.Behavior<System.Windows.FrameworkElement>.AssociatedObject
Microsoft.Xaml.Behaviors.Behavior.CreateInstanceCore()
Microsoft.Xaml.Behaviors.Behavior.Attach(System.Windows.DependencyObject)
Microsoft.Xaml.Behaviors.Behavior.Detach()
Microsoft.Xaml.Behaviors.Behavior.AssociatedType
Microsoft.Xaml.Behaviors.Behavior.Microsoft.Xaml.Behaviors.IAttachedObject.AssociatedObject
System.Windows.Media.Animation.Animatable.ApplyAnimationClock(System.Windows.DependencyProperty, System.Windows.Media.Animation.AnimationClock)
System.Windows.Media.Animation.Animatable.ApplyAnimationClock(System.Windows.DependencyProperty, System.Windows.Media.Animation.AnimationClock, System.Windows.Media.Animation.HandoffBehavior)
System.Windows.Media.Animation.Animatable.BeginAnimation(System.Windows.DependencyProperty, System.Windows.Media.Animation.AnimationTimeline)
System.Windows.Media.Animation.Animatable.BeginAnimation(System.Windows.DependencyProperty, System.Windows.Media.Animation.AnimationTimeline, System.Windows.Media.Animation.HandoffBehavior)
System.Windows.Media.Animation.Animatable.Clone()
System.Windows.Media.Animation.Animatable.FreezeCore(System.Boolean)
System.Windows.Media.Animation.Animatable.GetAnimationBaseValue(System.Windows.DependencyProperty)
System.Windows.Media.Animation.Animatable.HasAnimatedProperties
System.Windows.Freezable.CloneCore(System.Windows.Freezable)
System.Windows.Freezable.CloneCurrentValue()
System.Windows.Freezable.CloneCurrentValueCore(System.Windows.Freezable)
System.Windows.Freezable.CreateInstance()
System.Windows.Freezable.Freeze()
System.Windows.Freezable.Freeze(System.Windows.Freezable, System.Boolean)
System.Windows.Freezable.GetAsFrozen()
System.Windows.Freezable.GetAsFrozenCore(System.Windows.Freezable)
System.Windows.Freezable.GetCurrentValueAsFrozen()
System.Windows.Freezable.GetCurrentValueAsFrozenCore(System.Windows.Freezable)
System.Windows.Freezable.OnChanged()
System.Windows.Freezable.OnFreezablePropertyChanged(System.Windows.DependencyObject, System.Windows.DependencyObject)
System.Windows.Freezable.OnFreezablePropertyChanged(System.Windows.DependencyObject, System.Windows.DependencyObject, System.Windows.DependencyProperty)
System.Windows.Freezable.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
System.Windows.Freezable.ReadPreamble()
System.Windows.Freezable.WritePostscript()
System.Windows.Freezable.WritePreamble()
System.Windows.Freezable.CanFreeze
System.Windows.Freezable.IsFrozen
System.Windows.Freezable.Changed
System.Windows.DependencyObject.ClearValue(System.Windows.DependencyProperty)
System.Windows.DependencyObject.ClearValue(System.Windows.DependencyPropertyKey)
System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
System.Windows.DependencyObject.Equals(System.Object)
System.Windows.DependencyObject.GetHashCode()
System.Windows.DependencyObject.GetLocalValueEnumerator()
System.Windows.DependencyObject.GetValue(System.Windows.DependencyProperty)
System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty)
System.Windows.DependencyObject.ReadLocalValue(System.Windows.DependencyProperty)
System.Windows.DependencyObject.SetCurrentValue(System.Windows.DependencyProperty, System.Object)
System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty, System.Object)
System.Windows.DependencyObject.SetValue(System.Windows.DependencyPropertyKey, System.Object)
System.Windows.DependencyObject.ShouldSerializeProperty(System.Windows.DependencyProperty)
System.Windows.DependencyObject.DependencyObjectType
System.Windows.DependencyObject.IsSealed
System.Windows.Threading.DispatcherObject.Dispatcher
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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 System.Windows.DependencyProperty for the AdditionalExcludedElements.

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

IsActiveProperty

Identifies the System.Windows.DependencyProperty for IsActive.

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

OverlayTypeProperty

Identifies the System.Windows.DependencyProperty for OverlayType

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

Properties

View Source

AdditionalExcludedElements

Gets the additional excluded elements.

Declaration
public IList AdditionalExcludedElements { get; }
Property Value
Type Description
System.Collections.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
System.Boolean

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

System.Windows.Media.Animation.IAnimatable
Microsoft.Xaml.Behaviors.IAttachedObject

Extension Methods

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

See Also

Microsoft.Xaml.Behaviors.Behavior<T>
IOverlayEffect
  • View Source
In This Article
  • Constructors
    • OverlayEffectTriggerBehavior()
  • Fields
    • AdditionalExcludedElementsProperty
    • IsActiveProperty
    • OverlayTypeProperty
  • Properties
    • AdditionalExcludedElements
    • IsActive
    • OverlayType
  • Methods
    • OnAttached()
    • OnDetaching()
  • Implements
  • Extension Methods
  • See Also
Back to top Generated by DocFX