Exemple #1
0
        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);
        }
Exemple #2
0
 public WindowsPlatform(Microsoft.UI.Xaml.Window page) : base(page)
 {
 }
Exemple #3
0
        public static AppWindow GetAppWindow(this Microsoft.UI.Xaml.Window window)
        {
            IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);

            return(GetAppWindowFromWindowHandle(windowHandle));
        }