Why EnableDependentAnimation property in DoubleAnimation does not exist in WPF

653 Views Asked by At

I try to add animation to the height and width of a WPF Window. I saw that I should use the property EnableDependentAnimation in DoubleAnimation. This property is not enabled in WPF project but only Universal Window Application project, why?

1

There are 1 best solutions below

0
On

There is no EnableDependentAnimation property available in WPF because WPF has no concept of "dependent" animations.

You could still animate the size of a window though:

<Window x:Class="WpfApplication1.Window1"
    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:local="clr-namespace:WpfApplication1"
    mc:Ignorable="d"
    Title="Window1" Height="300" Width="300" x:Name="myWindow">
<Window.Triggers>
    <EventTrigger RoutedEvent="Loaded">
        <EventTrigger.Actions>
            <BeginStoryboard >
                <Storyboard  RepeatBehavior="Forever" AutoReverse="False">
                    <DoubleAnimation  Storyboard.TargetProperty = "Height" To="500" Duration="0:0:5"/>
                    <Storyboard  RepeatBehavior="Forever" AutoReverse="False">
                        <DoubleAnimation  Storyboard.TargetProperty="Width" To="500" Duration="0:0:5"/>
                    </Storyboard>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger.Actions>
    </EventTrigger>
</Window.Triggers>