atomui/samples/AtomUI.Demo.Desktop/App.axaml.cs
2024-09-10 00:09:07 +08:00

29 lines
744 B
C#

using AtomUI.Demo.Desktop.Views;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
namespace AtomUI.Demo.Desktop;
public class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
switch (ApplicationLifetime)
{
case IClassicDesktopStyleApplicationLifetime desktop:
desktop.MainWindow = new MainWindow();
break;
case ISingleViewApplicationLifetime singleView:
singleView.MainView = new MainView();
break;
}
base.OnFrameworkInitializationCompleted();
}
}