using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Input; using System; using Windows.Gaming.Input; using Windows.System; namespace AestheticComputer; public sealed partial class MainWindow : Window { private Gamepad? _gamepad; public MainWindow() { this.InitializeComponent(); // Make window fullscreen on Xbox var appWindow = this.AppWindow; appWindow.SetPresenter(Microsoft.UI.Windowing.AppWindowPresenterKind.FullScreen); // Initialize WebView2 InitializeWebView(); // Setup gamepad handling SetupGamepad(); } private async void InitializeWebView() { try { await webView.EnsureCoreWebView2Async(); // Configure WebView2 for optimal Xbox experience var settings = webView.CoreWebView2.Settings; settings.IsZoomControlEnabled = false; settings.AreDefaultContextMenusEnabled = false; settings.IsStatusBarEnabled = false; settings.AreBrowserAcceleratorKeysEnabled = false; // Inject Xbox-specific info await webView.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(@" window.isXboxApp = true; window.isDeviceMode = true; console.log('🎮 Aesthetic Computer Xbox App'); "); // Handle navigation errors webView.CoreWebView2.NavigationCompleted += (sender, args) => { if (!args.IsSuccess) { // Show offline message or retry webView.CoreWebView2.NavigateToString(@"
Please check your internet connection