51 lines
1.8 KiB
C#
51 lines
1.8 KiB
C#
using System.Runtime.CompilerServices;
|
|
using System.Windows;
|
|
using Intromat.Graphics;
|
|
using Intromat.ViewModels;
|
|
using Intromat.Views;
|
|
using NodeNetwork;
|
|
using NodeNetwork.Toolkit;
|
|
using ReactiveUI;
|
|
using Splat;
|
|
|
|
namespace Intromat
|
|
{
|
|
public partial class App : Application
|
|
{
|
|
public AutoSuspendHelper SuspendHelper { get; }
|
|
|
|
public App()
|
|
{
|
|
// Initialize the suspension driver after AutoSuspendHelper.
|
|
SuspendHelper = new AutoSuspendHelper(this);
|
|
RxApp.SuspensionHost.CreateNewAppState = () => new AppStateViewModel();
|
|
RxApp.SuspensionHost.SetupDefaultSuspendResume(new AkavacheSuspensionDriver<AppStateViewModel>());
|
|
}
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
var splashScreen = new SplashScreenWindow();
|
|
MainWindow = splashScreen;
|
|
splashScreen.Show();
|
|
|
|
var dxHost = new DxHost();
|
|
Locator.CurrentMutable.RegisterConstant(dxHost);
|
|
var mainWindow = new MainWindow { Visibility = Visibility.Collapsed };
|
|
|
|
base.OnStartup(e);
|
|
|
|
foreach (var assemblyType in typeof(NNViewRegistrar).Assembly.GetTypes())
|
|
RuntimeHelpers.RunClassConstructor(assemblyType.TypeHandle);
|
|
foreach (var assemblyType in typeof(NodeTemplate).Assembly.GetTypes())
|
|
RuntimeHelpers.RunClassConstructor(assemblyType.TypeHandle);
|
|
foreach (var assemblyType in GetType().Assembly.GetTypes())
|
|
RuntimeHelpers.RunClassConstructor(assemblyType.TypeHandle);
|
|
|
|
NNViewRegistrar.RegisterSplat();
|
|
MainWindow = mainWindow;
|
|
mainWindow.Show();
|
|
splashScreen.Close();
|
|
mainWindow.Visibility = Visibility.Visible;
|
|
}
|
|
}
|
|
} |