test: 添加测试项目
This commit is contained in:
26
Test/App.axaml.cs
Normal file
26
Test/App.axaml.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using JackCraft.I18N;
|
||||
|
||||
namespace Test;
|
||||
|
||||
public class App : Application
|
||||
{
|
||||
public static I18NManager I18NManager { get; set; } = new("Test.Assets.Resources", typeof(App).Assembly);
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
I18NManager.Culture = new CultureInfo("zh");
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
desktop.MainWindow = new MainWindow();
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user