Simple design side animation example in wpf application

Leave a Comment
Simple design side animation example in wpf application is here. We don't need to explain it but you need to put this code snippets in design page only.

Mainwindow
<Window x:Class="DesignSideAnnimation.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Button Content="Animated Me!!!" Width="50" Height="40" >
            <Button.Triggers>
                <EventTrigger RoutedEvent="Button.Click">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard TargetProperty="Width" >
                                <DoubleAnimation From="50" To="250" Duration="0:0:5" AutoReverse="True"></DoubleAnimation>
                            </Storyboard>
                         
                        </BeginStoryboard>
                     
                    </EventTrigger.Actions>
                 
                 
                </EventTrigger>
             
             
            </Button.Triggers>
         
         
        </Button>
    </Grid>
</Window>
Output will look like this.


0 comments:

Post a Comment