-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplashWindow.xaml.cs
More file actions
39 lines (35 loc) · 979 Bytes
/
Copy pathSplashWindow.xaml.cs
File metadata and controls
39 lines (35 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Animation;
namespace Passpix
{
public partial class SplashWindow : Window
{
public SplashWindow()
{
InitializeComponent();
Loaded += SplashWindow_Loaded;
}
private async void SplashWindow_Loaded(object sender, RoutedEventArgs e)
{
// Start Fade-In Animation
if (Resources["FadeInStoryboard"] is Storyboard fadeIn)
{
fadeIn.Begin(this);
}
// Wait 1.5 seconds (1500 milliseconds)
await Task.Delay(1500);
// Start Fade-Out Animation
if (Resources["FadeOutStoryboard"] is Storyboard fadeOut)
{
fadeOut.Completed += (s, ev) => Close();
fadeOut.Begin(this);
}
else
{
Close();
}
}
}
}