WPF panel moves to the left of the animation

I am trying to make the panel animate the sliding behavior in WPF. I am new to animation and am having problems. The panel is filled from the center, not to the left, and it only enlivens for the first time. I know that I am doing something wrong, so any help would be appreciated. Below is the markup for my animation.

<Style.Triggers>
        <Trigger  Property="Visibility" Value="Visible">
            <Trigger.EnterActions>
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation From="0" To="200" Duration="0:0:0.5"
                                         AccelerationRatio="0.2" DecelerationRatio="0.1"
                                         Storyboard.TargetProperty="Width"/>
                    </Storyboard>
                </BeginStoryboard>
            </Trigger.EnterActions>
        </Trigger>
    </Style.Triggers>
+4
source share
1 answer

Do not animate properties such as Width, which is what RenderTransform is for.

To get the behavior you described ("Sliding"), you want to animate TranslateTransform from some X from the screen / page to the end position.

, XAML , ScaleTransform , .

, , . question

RenderTransforms (MSDN)

+2

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


All Articles