diff --git a/MCTG/Views/App.xaml.cs b/MCTG/Views/App.xaml.cs index 62a4cdd..681e3c1 100644 --- a/MCTG/Views/App.xaml.cs +++ b/MCTG/Views/App.xaml.cs @@ -1,13 +1,38 @@ -namespace Views +using Microsoft.UI; +using Windows.Graphics; + +#if WINDOWS +//using Microsoft.UI; +using Microsoft.UI.Windowing; +//using Windows.Graphics; +#endif + +namespace Views { public partial class App : Application { + const int WindowWidth = 1200; + const int WindowHeight = 800; + public App() { InitializeComponent(); + Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) => + { +#if WINDOWS + var mauiWindow = handler.VirtualView; + var nativeWindow = handler.PlatformView; + nativeWindow.Activate(); + IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(nativeWindow); + WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle); + AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId); + appWindow.Resize(new SizeInt32(WindowWidth, WindowHeight)); +#endif + }); + MainPage = new AppShell(); Application.Current.UserAppTheme = AppTheme.Light; } } -} \ No newline at end of file +} diff --git a/MCTG/Views/AppShell.xaml b/MCTG/Views/AppShell.xaml index 488a12d..da7a51f 100644 --- a/MCTG/Views/AppShell.xaml +++ b/MCTG/Views/AppShell.xaml @@ -8,10 +8,57 @@ Shell.FlyoutBehavior="Flyout" Shell.NavBarIsVisible="False"> - + + + + + + + + + + + +