using Microsoft.UI.Xaml; using WinRT.Interop; namespace AmiReel; /// /// Provides application-specific behavior to supplement the default Application class. /// public partial class App : Application { private Window? _window; public static IntPtr MainWindowHandle { get; private set; } public static MainWindow? MainWindowInstance { get; internal set; } /// /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// public App() { InitializeComponent(); } /// /// Invoked when the application is launched. /// /// Details about the launch request and process. protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { _window = new MainWindow(); MainWindowHandle = WindowNative.GetWindowHandle(_window); _window.Activate(); } }