Today, I decided to play around with WPF a little bit. I created a simple App for animating a logo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Storyboard stbFadeOut = (Storyboard)FindResource("FadeOut"); stbFadeOut.Begin(); } private void Storyboard_Completed(object sender, EventArgs e) { MessageBox.Show("Complated."); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<Window x:Class="TestApp.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" WindowState="Maximized" WindowStyle="None"> <Window.Resources> <Storyboard x:Key="FadeOut" Name="FadeOutLogoAnimation" Completed="Storyboard_Completed"> <DoubleAnimation From="1" To="0" Storyboard.TargetName="Logo" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0:0:5"/> </Storyboard> </Window.Resources> <Grid Name="MainGrid"> <Image Source="yourlogo.png" Name="Logo" HorizontalAlignment="Center" Stretch="Uniform" VerticalAlignment="Center"> </Image> </Grid> </Window> |