Program.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using Avalonia;
  2. using Avalonia.Controls;
  3. using Avalonia.Controls.ApplicationLifetimes;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Globalization;
  7. using Xilium.CefGlue;
  8. using Xilium.CefGlue.Common;
  9. using Xilium.CefGlue.Common.Shared;
  10. namespace Flyinsono.Demo
  11. {
  12. class Program
  13. {
  14. // Initialization code. Don't use any Avalonia, third-party APIs or any
  15. // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
  16. // yet and stuff might break.
  17. public static void Main(string[] args)
  18. {
  19. BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
  20. }
  21. // Avalonia configuration, don't remove; also used by visual designer.
  22. public static AppBuilder BuildAvaloniaApp()
  23. {
  24. return AppBuilder.Configure<App>()
  25. .UsePlatformDetect()
  26. .AfterSetup(_ => CefRuntimeLoader.Initialize(
  27. new CefSettings() { Locale = CultureInfo.CurrentCulture.Name},
  28. flags: new[] {new KeyValuePair<string, string>("autoplay-policy", "no-user-gesture-required")}));
  29. }
  30. }
  31. }