Program.cs 771 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using Avalonia;
  3. namespace BuildTests.Desktop;
  4. internal static class Program
  5. {
  6. [STAThread]
  7. public static void Main(string[] args)
  8. => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
  9. public static AppBuilder BuildAvaloniaApp()
  10. {
  11. var builder = AppBuilder.Configure<App>()
  12. .UseSkia()
  13. .LogToTrace();
  14. // We don't use Avalonia.Desktop with UsePlatformDetect() because Avalonia.Native is only built on macOS,
  15. // causing restore to fail for the exact package versions we're using in this solution.
  16. if (OperatingSystem.IsWindows())
  17. builder.UseWin32();
  18. else if (OperatingSystem.IsLinux())
  19. builder.UseX11();
  20. return builder;
  21. }
  22. }