Program.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Linq;
  3. using Avalonia;
  4. using IntegrationTestApp.Embedding;
  5. namespace IntegrationTestApp
  6. {
  7. class Program
  8. {
  9. public static bool OverlayPopups { get; private set; }
  10. // Initialization code. Don't use any Avalonia, third-party APIs or any
  11. // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
  12. // yet and stuff might break.
  13. public static void Main(string[] args)
  14. {
  15. OverlayPopups = args.Contains("--overlayPopups");
  16. BuildAvaloniaApp()
  17. .With(new Win32PlatformOptions
  18. {
  19. OverlayPopups = OverlayPopups,
  20. })
  21. .With(new AvaloniaNativePlatformOptions
  22. {
  23. OverlayPopups = OverlayPopups,
  24. })
  25. .StartWithClassicDesktopLifetime(args);
  26. }
  27. // Avalonia configuration, don't remove; also used by visual designer.
  28. public static AppBuilder BuildAvaloniaApp()
  29. => AppBuilder.Configure<App>()
  30. .UsePlatformDetect()
  31. .AfterSetup(builder =>
  32. {
  33. NativeTextBox.Factory =
  34. OperatingSystem.IsWindows() ? new Win32TextBoxFactory() :
  35. OperatingSystem.IsMacOS() ? new MacOSTextBoxFactory() :
  36. null;
  37. })
  38. .LogToTrace();
  39. }
  40. }