wabbajack/Wabbajack.Launcher/App.axaml.cs

28 lines
748 B
C#
Raw Normal View History

2021-10-08 13:16:51 +00:00
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Microsoft.Extensions.DependencyInjection;
2021-10-08 13:16:51 +00:00
using Wabbajack.Launcher.ViewModels;
using Wabbajack.Launcher.Views;
2021-10-23 16:51:17 +00:00
namespace Wabbajack.Launcher;
public class App : Application
2021-10-08 13:16:51 +00:00
{
2021-10-23 16:51:17 +00:00
public override void Initialize()
2021-10-08 13:16:51 +00:00
{
2021-10-23 16:51:17 +00:00
AvaloniaXamlLoader.Load(this);
}
2021-10-08 13:16:51 +00:00
2021-10-23 16:51:17 +00:00
public override void OnFrameworkInitializationCompleted()
{
2021-10-23 16:51:17 +00:00
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
desktop.MainWindow = new MainWindow
2021-10-08 13:16:51 +00:00
{
DataContext = Program.Services.GetRequiredService<MainWindowViewModel>()
2021-10-23 16:51:17 +00:00
};
2021-10-08 13:16:51 +00:00
2021-10-23 16:51:17 +00:00
base.OnFrameworkInitializationCompleted();
2021-10-08 13:16:51 +00:00
}
}