Can you define a storyboard to play before the property changes?

For example, I set Visibility to turn on and off for a specific item. I have a Trigger that listens for the Visibility parameter set to Visible and casts a storyboard that disappears in the element.

So, on the flip side, when the item is set to Hidden, I want the item to disappear, and then the property is set to Visibility = false. Is this possible, and if so, how? I currently have something like:

    <Style.Triggers>
        <Trigger Property="Visibility" Value="Visible">
            <Trigger.EnterActions>
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" />
                    </Storyboard>
                </BeginStoryboard>
            </Trigger.EnterActions>
            <Trigger.ExitActions>
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.5" />
                    </Storyboard>
                </BeginStoryboard>
            </Trigger.ExitActions>
        </Trigger>
    </Style.Triggers>
+3
source share
1 answer

, . , , .

MSDN:

: Trigger, MultiTrigger, EventTrigger, DataTrigger MultiDataTrigger.

, DataTrigger , ? EventTrigger ? ..

+2

Source: https://habr.com/ru/post/1710321/


All Articles