Effect on window opening WPF

1

I'd like to create an effect on opening my window in WPF, similar to the opening of Windows 10's Weather and Mail windows.

When I open the window, the Background gets a color and an image, then it disappears, and the window is displayed Normally:

Does anyone know of a tutorial, tip or page explaining how to use this feature?

    
asked by anonymous 14.11.2017 / 14:23

1 answer

0

Hello, the animation you want can be created from the following structure:

<Grid x:Name="Background">
        <Grid.Triggers>
            <EventTrigger RoutedEvent="Grid.Loaded">
                <BeginStoryboard>
                    <Storyboard>
                        <ThicknessAnimation Storyboard.TargetProperty="item1" From="item2" To="item3" DecelerationRatio="0.9" Duration="0:0:0.5"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>

Explaining Best

Within your control (in the case of the grid), you add the container Triggers (trigger) that will trigger your event, then set EventTrigger as container and BeginStoryBoard to populate what happens at the start of the event and RoutedEvent gets the name of the target control of the animation and its trigger, the structure may change depending on the animation you want .

item1 is the target property, where the animation will be applied.

item2 the initial value of this property.

item3 the final value of this property.

Duration is the duration time of the animation, in the example above it is 1/2 of a second.

for more details: link link

source: link

    
14.11.2017 / 17:33