AppDelegate.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using Avalonia;
  2. using Avalonia.iOS;
  3. using Foundation;
  4. using InABox.Avalonia.Platform;
  5. using InABox.Avalonia.Platform.iOS; //using InABox.Avalonia.Platform;
  6. //using InABox.Avalonia.Platform.iOS;
  7. using ObjCRuntime;
  8. namespace PRS.Avalonia.iOS;
  9. // The UIApplicationDelegate for the application. This class is responsible for launching the
  10. // User Interface of the application, as well as listening (and optionally responding) to
  11. // application events from iOS.
  12. [Register("AppDelegate")]
  13. #pragma warning disable CA1711 // Identifiers should not have incorrect suffix
  14. public partial class AppDelegate : AvaloniaAppDelegate<App>
  15. #pragma warning restore CA1711 // Identifiers should not have incorrect suffix
  16. {
  17. protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
  18. {
  19. PlatformTools.Register<IDeviceId, iOS_DeviceId>();
  20. PlatformTools.Register<IAppVersion,iOS_AppVersion>();
  21. PlatformTools.Register<IImageTools, iOS_ImageTools>();
  22. PlatformTools.Register<IPdfRenderer, iOS_PdfRenderer>();
  23. var result = base.CustomizeAppBuilder(builder);
  24. result = result.UseSkia();
  25. result = result.WithInterFont();
  26. //if (Runtime.Arch == Arch.SIMULATOR)
  27. result = result.With(new iOSPlatformOptions { RenderingMode = [iOSRenderingMode.OpenGl] });
  28. return result;
  29. }
  30. }