Show / Hide Table of Contents

Interface IOverlayEffect

Defines methods to apply overlay effects to windows.

Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public interface IOverlayEffect
Examples

The following example illustrates how to import the IOverlayEffect implementation.

    [ImportingConstructor]
    public OverlayEffectViewModelExamples(IOverlayEffect overlayEffect)
    {
        this.overlayEffect = overlayEffect;
    }

The following example illustrates how to use the IOverlayEffect on all overlay-able windows.

        using (this.overlayEffect.Apply())
        {
            ShowDialog();
        }

The following example illustrates how to use the IOverlayEffect on all overlay-able windows but spare a single control.

        var args = new OverlayArguments();
        args.ExcludedElements.Add(editControl);

        using (this.overlayEffect.Apply(args))
        {
            await editControl.StartEditing().ConfigureAwait(true);
        }

The following example illustrates how to prevent a window from being overlaid by using the IsAllowedProperty.

<Window x:Class="ExcludedFromOverlay.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:SAF="http://www.sartorius.com/SAF"
    SAF:OverlayEffect.IsAllowed="False"
    mc:Ignorable="d"
    Title="Main Window" Height="300" Width="300">
<Grid>
    <!-- content of window -->
</Grid>
</Window>

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>

Methods

View Source

Apply()

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

Declaration
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
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

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)

See Also

OverlayArguments
OverlayEffectTriggerBehavior
  • View Source
Back to top Generated by DocFX