mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Initial commit
This commit is contained in:
40
RedBookPlayer/App.xaml.cs
Normal file
40
RedBookPlayer/App.xaml.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace RedBookPlayer
|
||||
{
|
||||
public class App : Application
|
||||
{
|
||||
public static string CurrentTheme = "default";
|
||||
|
||||
static App()
|
||||
{
|
||||
Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName));
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += (e, f) =>
|
||||
{
|
||||
Console.WriteLine(((Exception)f.ExceptionObject).ToString());
|
||||
};
|
||||
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
desktop.MainWindow = new MainWindow();
|
||||
desktop.ShutdownMode = ShutdownMode.OnMainWindowClose;
|
||||
}
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user