2021-10-08 13:16:51 +00:00
|
|
|
using Avalonia;
|
|
|
|
using Avalonia.Controls.ApplicationLifetimes;
|
|
|
|
using Avalonia.Markup.Xaml;
|
2022-06-01 21:45:55 +00:00
|
|
|
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()
|
|
|
|
{
|
2022-06-01 21:45:55 +00:00
|
|
|
|
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
|
|
|
{
|
2022-06-01 21:45:55 +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
|
|
|
}
|
|
|
|
}
|