using Microsoft.UI.Xaml;
using TeamsISO.App.WinUI.Views;

namespace TeamsISO.App.WinUI;

/// <summary>
/// WinUI 3 application entry. The full startup pipeline from the WPF host
/// (NDI runtime preflight, IsoController wiring, single-instance mutex, REST
/// + OSC bridge, tray icon, crash diagnostics, auto-update banner, onboarding)
/// will migrate over in subsequent commits — this initial scaffold just brings
/// up MainWindow so the redesigned shell can be developed and previewed.
///
/// The engine layer (TeamsISO.Engine) is unchanged; the WinUI 3 host's
/// responsibility is binding its view-models to the same controller surface
/// the WPF host already uses.
/// </summary>
public partial class App : Application
{
    private Window? _mainWindow;

    public App()
    {
        InitializeComponent();
    }

    protected override void OnLaunched(LaunchActivatedEventArgs args)
    {
        _mainWindow = new MainWindow();
        _mainWindow.Activate();
    }

    /// <summary>
    /// Exposes the active main window so settings can swap RequestedTheme on
    /// the root element without having to thread the Window reference through
    /// every consumer.
    /// </summary>
    internal Window? MainWindow => _mainWindow;
}
