mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-08-01 21:32:18 +02:00
WPF
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
using Avalonia;
|
||||
using System.Diagnostics;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ThemeManager;
|
||||
using MessageBox.Avalonia.DTO;
|
||||
using MessageBox.Avalonia.Enums;
|
||||
using MessageBox.Avalonia.Models;
|
||||
using UVtools.Core.FileFormats;
|
||||
|
||||
namespace UVtools.WPF
|
||||
{
|
||||
public class App : Application
|
||||
{
|
||||
public static IThemeSelector? Selector { get; set; }
|
||||
|
||||
public static FileFormat SlicerFile = null;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
@@ -15,10 +25,24 @@ namespace UVtools.WPF
|
||||
{
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
desktop.MainWindow = new MainWindow();
|
||||
Selector = ThemeSelector.Create("Themes");
|
||||
Selector.LoadSelectedTheme("UVtools.theme");
|
||||
desktop.MainWindow = new MainWindow
|
||||
{
|
||||
//DataContext = Selector
|
||||
};
|
||||
desktop.Exit += (sender, e)
|
||||
=> Selector.SaveSelectedTheme("UVtools.theme");
|
||||
|
||||
Debug.WriteLine(Selector.Themes[1].Name);
|
||||
}
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
|
||||
#region Utilities
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user