diff --git a/Flow.Launcher.Core/AppExtensions.cs b/Flow.Launcher.Core/AppExtensions.cs new file mode 100644 index 000000000..b02612d72 --- /dev/null +++ b/Flow.Launcher.Core/AppExtensions.cs @@ -0,0 +1,15 @@ +using System.Windows; +using Flow.Launcher.Plugin; + +namespace Flow.Launcher.Core; + +/// +/// Extension properties and functions of the current application singleton object. +/// +public static class AppExtensions +{ + /// + /// Gets the public API of the current application singleton object. + /// + public static IPublicAPI API => (Application.Current as IApp)!.PublicAPI; +} diff --git a/Flow.Launcher.Core/IApp.cs b/Flow.Launcher.Core/IApp.cs new file mode 100644 index 000000000..233fd5ed1 --- /dev/null +++ b/Flow.Launcher.Core/IApp.cs @@ -0,0 +1,13 @@ +using Flow.Launcher.Plugin; + +namespace Flow.Launcher.Core +{ + /// + /// Interface for the current application singleton object exposing the properties + /// and functions that can be accessed from anywhere in the application. + /// + public interface IApp + { + public IPublicAPI PublicAPI { get; } + } +}