App.axaml.cs 589 B

123456789101112131415161718192021222324
  1. using Avalonia;
  2. using Avalonia.Controls.ApplicationLifetimes;
  3. using Avalonia.Markup.Xaml;
  4. namespace _01_02_MDK
  5. {
  6. public partial class App : Application
  7. {
  8. public override void Initialize()
  9. {
  10. AvaloniaXamlLoader.Load(this);
  11. }
  12. public override void OnFrameworkInitializationCompleted()
  13. {
  14. if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
  15. {
  16. desktop.MainWindow = new MainWindow();
  17. }
  18. base.OnFrameworkInitializationCompleted();
  19. }
  20. }
  21. }