public static IMauiContext MakeWindowScope(this IMauiContext mauiContext, NativeWindow platformWindow, out IServiceScope scope) { scope = mauiContext.Services.CreateScope(); #if ANDROID var scopedContext = new MauiContext(scope.ServiceProvider, platformWindow); #else var scopedContext = new MauiContext(scope.ServiceProvider); #endif scopedContext.AddWeakSpecific(platformWindow); #if ANDROID scopedContext.AddSpecific(new NavigationRootManager(scopedContext)); #endif #if WINDOWS scopedContext.AddSpecific(new NavigationRootManager(platformWindow)); #endif return(scopedContext); }
public WindowsPlatform(Microsoft.UI.Xaml.Window page) : base(page) { }
public static AppWindow GetAppWindow(this Microsoft.UI.Xaml.Window window) { IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window); return(GetAppWindowFromWindowHandle(windowHandle)); }