2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-04-05 01:29:38 -04:00
pulsar/ObservatoryCore/UI/MainApplication.axaml.cs
2021-06-03 22:25:32 -02:30

30 lines
826 B
C#

using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Observatory.UI.ViewModels;
namespace Observatory.UI
{
public class MainApplication : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
var pluginManager = PluginManagement.PluginManager.GetInstance;
desktop.MainWindow = new Views.MainWindow()
{
DataContext = new MainWindowViewModel(pluginManager)
};
}
base.OnFrameworkInitializationCompleted();
}
}
}