diff --git a/src/Gtk/Perspex.Cairo/CairoPlatform.cs b/src/Gtk/Perspex.Cairo/CairoPlatform.cs index 2c72811bbb..36078a1196 100644 --- a/src/Gtk/Perspex.Cairo/CairoPlatform.cs +++ b/src/Gtk/Perspex.Cairo/CairoPlatform.cs @@ -7,6 +7,18 @@ using Perspex.Cairo.Media.Imaging; using Perspex.Media; using Perspex.Platform; +namespace Perspex +{ + public static class GtkApplicationExtensions + { + public static AppT UseCairo(this AppT app) where AppT : Application + { + Perspex.Cairo.CairoPlatform.Initialize(); + return app; + } + } +} + namespace Perspex.Cairo { using System.IO; diff --git a/src/Gtk/Perspex.Gtk/GtkPlatform.cs b/src/Gtk/Perspex.Gtk/GtkPlatform.cs index b8a6d5c511..b3de47f4eb 100644 --- a/src/Gtk/Perspex.Gtk/GtkPlatform.cs +++ b/src/Gtk/Perspex.Gtk/GtkPlatform.cs @@ -10,6 +10,18 @@ using Perspex.Input; using Perspex.Platform; using Perspex.Shared.PlatformSupport; +namespace Perspex +{ + public static class GtkApplicationExtensions + { + public static AppT UseGtkSubsystem(this AppT app) where AppT : Application + { + Perspex.Gtk.GtkPlatform.Initialize(); + return app; + } + } +} + namespace Perspex.Gtk { using Gtk = global::Gtk; diff --git a/src/Skia/Perspex.Skia/SkiaPlatform.cs b/src/Skia/Perspex.Skia/SkiaPlatform.cs index 00c5494308..2161397dd9 100644 --- a/src/Skia/Perspex.Skia/SkiaPlatform.cs +++ b/src/Skia/Perspex.Skia/SkiaPlatform.cs @@ -3,6 +3,18 @@ using System.Collections.Generic; using System.Text; using Perspex.Platform; +namespace Perspex +{ + public static class SkiaApplicationExtensions + { + public static AppT UseSkia(this AppT app) where AppT : Application + { + Perspex.Skia.SkiaPlatform.Initialize(); + return app; + } + } +} + namespace Perspex.Skia { public static class SkiaPlatform diff --git a/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs b/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs index 93c820b26d..fa6be34844 100644 --- a/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs +++ b/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs @@ -7,6 +7,18 @@ using Perspex.Direct2D1.Media; using Perspex.Media; using Perspex.Platform; +namespace Perspex +{ + public static class Direct2DApplicationExtensions + { + public static AppT UseDirect2D(this AppT app) where AppT : Application + { + Perspex.Direct2D1.Direct2D1Platform.Initialize(); + return app; + } + } +} + namespace Perspex.Direct2D1 { public class Direct2D1Platform : IPlatformRenderInterface diff --git a/src/Windows/Perspex.Win32/Win32Platform.cs b/src/Windows/Perspex.Win32/Win32Platform.cs index 5fb0a7c4b7..c2f4943e28 100644 --- a/src/Windows/Perspex.Win32/Win32Platform.cs +++ b/src/Windows/Perspex.Win32/Win32Platform.cs @@ -16,6 +16,18 @@ using Perspex.Shared.PlatformSupport; using Perspex.Win32.Input; using Perspex.Win32.Interop; +namespace Perspex +{ + public static class Win32ApplicationExtensions + { + public static AppT UseWin32Subsystem(this AppT app) where AppT : Application + { + Perspex.Win32.Win32Platform.Initialize(); + return app; + } + } +} + namespace Perspex.Win32 { public class Win32Platform : IPlatformThreadingInterface, IPlatformSettings, IWindowingPlatform