mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Settings - Fixed updating issues in plugin tab UI - Don't initialize in design mode UI - Move ReactiveCoreWindow to Artemis.Shared Window service - Return window created by ShowWindow Window service - Added CreateOpenFileDialog API
46 lines
1.5 KiB
C#
46 lines
1.5 KiB
C#
using Artemis.Core.Services;
|
|
using Artemis.UI.Windows.Ninject;
|
|
using Artemis.UI.Windows.Providers.Input;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls.ApplicationLifetimes;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.Threading;
|
|
using Ninject;
|
|
using ReactiveUI;
|
|
|
|
namespace Artemis.UI.Windows
|
|
{
|
|
public class App : Application
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
_kernel = ArtemisBootstrapper.Bootstrap(this, new WindowsModule());
|
|
Program.CreateLogger(_kernel);
|
|
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
public override void OnFrameworkInitializationCompleted()
|
|
{
|
|
if (ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop || Design.IsDesignMode)
|
|
return;
|
|
|
|
ArtemisBootstrapper.Initialize();
|
|
_applicationStateManager = new ApplicationStateManager(_kernel!, desktop.Args);
|
|
RegisterProviders(_kernel!);
|
|
}
|
|
|
|
private void RegisterProviders(StandardKernel standardKernel)
|
|
{
|
|
IInputService inputService = standardKernel.Get<IInputService>();
|
|
inputService.AddInputProvider(standardKernel.Get<WindowsInputProvider>());
|
|
}
|
|
|
|
private StandardKernel? _kernel;
|
|
|
|
// ReSharper disable NotAccessedField.Local
|
|
private ApplicationStateManager? _applicationStateManager;
|
|
// ReSharper restore NotAccessedField.Local
|
|
}
|
|
} |