Show / Hide Table of Contents

Class OverlayEffect

Implements functionality to overlay wpf controls of type Window with a 'darken out' effect.

Inheritance
object
DispatcherObject
DependencyObject
OverlayEffect
Implements
IOverlayEffect
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.DependencyObjectType
DependencyObject.IsSealed
DispatcherObject.Dispatcher
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public sealed class OverlayEffect : DependencyObject, IOverlayEffect
Remarks

The OverlayEffect is only applied to a Window that has a Grid as content.

The OverlayEffect is typically used when showing a modal dialog.

The instance of the OverlayEffect must be obtained using the ImportingConstructorAttribute.

See IOverlayEffect or OverlayEffectTriggerBehavior for code examples.

Examples

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>

Fields

View Source

IsAllowedProperty

Identifies the DependencyProperty for SetIsAllowed(Window, bool) and GetIsAllowed(Window).

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

IsOverlayedProperty

Identifies the DependencyProperty for the Sartorius.SAF.Effects.OverlayEffect.IsOverlayed attached property.

Declaration
public static readonly DependencyProperty IsOverlayedProperty
Field Value
Type Description
DependencyProperty

Properties

View Source

Instance

Gets the singleton instance of the OverlayEffect class.

Declaration
public static IOverlayEffect Instance { get; }
Property Value
Type Description
IOverlayEffect

Methods

View Source

Apply()

Applies an overlay effect to all application windows that don't have an overlay effect yet.

Declaration
public IDisposable Apply()
Returns
Type Description
IDisposable

An instance of IDisposable that removes the effect on dispose.

Remarks

Windows that have OverlayEffect.IsAllowed set to false will not get overlaid.

View Source

Apply(OverlayArguments)

Applies an overlay according to the specified OverlayArguments.

Declaration
public IDisposable Apply(OverlayArguments arguments)
Parameters
Type Name Description
OverlayArguments arguments

The OverlayArguments that specify the scope of the overlay.

Returns
Type Description
IDisposable

An instance of IDisposable that removes the effect on dispose.

Remarks

In MVVM scenarios consider to use the OverlayEffectTriggerBehavior.

See Also
OverlayArguments
OverlayEffectTriggerBehavior
View Source

Clear()

Declaration
public static void Clear()
View Source

GetIsAllowed(Window)

Gets a bool specifying whether the specified Window may be overlaid by an overlay effect.

Declaration
[AttachedPropertyBrowsableForType(typeof(Window))]
public static bool GetIsAllowed(Window window)
Parameters
Type Name Description
Window window

The element.

Returns
Type Description
bool

a bool specifying whether the specified window may be overlaid by an overlay effect.

See Also
SetIsAllowed(Window, bool)
View Source

GetIsOverlayed(DependencyObject)

Gets a value indicating whether the element is currently overlaid by an overlay effect.

Declaration
public static bool GetIsOverlayed(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The element.

Returns
Type Description
bool
View Source

SetIsAllowed(Window, bool)

Sets a bool specifying whether the specified Window may be overlaid by an overlay effect.

Declaration
[AttachedPropertyBrowsableForType(typeof(Window))]
public static void SetIsAllowed(Window window, bool value)
Parameters
Type Name Description
Window window

The window for which to set the Sartorius.SAF.Effects.OverlayEffect.IsAllowed property.

bool value

If set to false the Window will never be overlaid.

Remarks

The default is true. When an overlay effect is configured to use the window as source window by setting SourceReference and setting Type to SourceWindow this property will have no effect on the overlay effect, and it will be applied to the window.

See Also
GetIsAllowed(Window)

Implements

IOverlayEffect

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

IOverlayEffect
OverlayEffectTriggerBehavior
  • View Source
Back to top Generated by DocFX