Creating an Advanced Message dialog that uses fading and auto-closes

This feature is only available with Arellia Application Control Agent version 7.1.1685.0 onwards.

Open up your Advanced message dialog in the Arellia console.
Under the Window Design section of the dialog make the following changes:

1. In the <Window> element definition add the following attribute:

<Window>
    ...
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    ...
</Window>

2. Optionally you can add some or all of the following attributes to the <Window> definition to style the dialog as desired:

<Window>
    ...
    <!-- This will prevent the dialog from stealing focus -->
    ShowActivated="False"

    <!-- This will ensure the dialog will appear as the top most window -->
    Topmost="True"

    <!-- This will display the dialog without the usual titlebar or borders -->
    WindowStyle="None"
    ...
</Window>

3. Optionally you can add the following to fade in/fade out the dialog. After the <Window> element and before the <Window.Resources> element add:

...
</Window>

<!-- Start of section to add -->
<Window.Triggers>
    <EventTrigger RoutedEvent="Window.Loaded">
        <BeginStoryboard>
            <Storyboard>

                <!-- Fade-in window duration, default 2 seconds -->
                <DoubleAnimation Duration="0:0:2" From="0.0" To="1.0"
                    Storyboard.Target="{Binding ElementName=MainWindow}"
                    Storyboard.TargetProperty="(UIElement.Opacity)" />

                <!-- Fade-out window starts after 5 seconds, duration of 1 second -->
                <DoubleAnimation BeginTime="0:0:5" Duration="0:0:1" From="1.0" To="0.0"
                    Storyboard.Target="{Binding ElementName=MainWindow}"
                    Storyboard.TargetProperty="(UIElement.Opacity)" />

            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</Window.Triggers>
<!-- End of section to add -->

<Window.Resources>
...

3. At the end of the Xaml document just before the closing </Window> tag add the following:

    ...
    </StackPanel>

    <!-- Start of section to add -->
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">

            <!-- Automatically close Xaml dialog after 6 seconds -->
            <adx:InvokeCommandWithDelayAction x:Name="CloseAction" Command="{Binding CloseCommand}" Delay="0:0:6" />

        </i:EventTrigger>
    </i:Interaction.Triggers>
    <!-- End of section to add -->

</Window>