App.axaml.cs 749 B

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