using Windows.ApplicationModel.Activation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; namespace ComputeSharp.SwapChain.Uwp; /// /// Provides application-specific behavior to supplement the default Application class. /// sealed partial class App : Application { /// /// 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(); } /// protected override void OnLaunched(LaunchActivatedEventArgs e) { // Initialize the frame if needed if (Window.Current.Content is not Frame rootFrame) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); // Place the frame in the current Window Window.Current.Content = rootFrame; } if (!e.PrelaunchActivated) { if (rootFrame.Content is null) { // Navigate to the root page _ = rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); } } }