-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.xaml.cs
42 lines (33 loc) · 1.07 KB
/
App.xaml.cs
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
40
41
42
using System.Threading;
using System.Windows;
namespace BF1RecordQuery
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public static ISplashScreen splashScreen;
private ManualResetEvent ResetSplashCreated;
private Thread SplashThread;
protected override void OnStartup(StartupEventArgs e)
{
ResetSplashCreated = new ManualResetEvent(false);
SplashThread = new Thread(ShowSplash);
SplashThread.SetApartmentState(ApartmentState.STA);
SplashThread.IsBackground = true;
SplashThread.Name = "Splash Screen";
SplashThread.Start();
ResetSplashCreated.WaitOne();
base.OnStartup(e);
}
private void ShowSplash()
{
LaunchWindow launchWindow = new LaunchWindow();
splashScreen = launchWindow;
launchWindow.Show();
ResetSplashCreated.Set();
System.Windows.Threading.Dispatcher.Run();
}
}
}