Show / Hide Table of Contents

Class OverlayEffect

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

Inheritance
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
OverlayEffect
Implements
IOverlayEffect
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.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
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
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public sealed class OverlayEffect : DependencyObject, IOverlayEffect
Remarks

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

The OverlayEffect is typically used when showing a modal dialog.

The instance of the OverlayEffect must be obtained using the System.ComponentModel.Composition.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 System.Windows.DependencyProperty for SetIsAllowed(Window, Boolean) and GetIsAllowed(Window).

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

IsOverlayedProperty

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

Declaration
public static readonly DependencyProperty IsOverlayedProperty
Field Value
Type Description
System.Windows.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
System.IDisposable

An instance of System.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
System.IDisposable

An instance of System.IDisposable that removes the effect on dispose.

Remarks

In MVVM scenarios consider to use the OverlayEffectTriggerBehavior.

See Also
OverlayArguments
OverlayEffectTriggerBehavior
View Source

GetIsAllowed(Window)

Gets a System.Boolean specifying whether the specified System.Windows.Window may be overlaid by an overlay effect.

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

The element.

Returns
Type Description
System.Boolean

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

See Also
SetIsAllowed(Window, Boolean)
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
System.Windows.DependencyObject element

The element.

Returns
Type Description
System.Boolean
View Source

SetIsAllowed(Window, Boolean)

Sets a System.Boolean specifying whether the specified System.Windows.Window may be overlaid by an overlay effect.

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

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

System.Boolean value

If set to false the System.Windows.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.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

IOverlayEffect
OverlayEffectTriggerBehavior
  • View Source
Back to top Generated by DocFX