diff --git a/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs b/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs index cccc9e3a73..55e5b09c92 100644 --- a/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs +++ b/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs @@ -14,5 +14,6 @@ private void SyncfusionDemoPage_Loaded(object sender, EventArgs e) var pv = Window?.Handler?.PlatformView; var hpv = Handler?.PlatformView; + var current = DeviceDisplay.Current; } } diff --git a/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs b/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs index 4921f32d1a..bfd4404b20 100644 --- a/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs +++ b/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Maui.ApplicationModel; using Uno.Extensions.Hosting; namespace Uno.Extensions.Maui; @@ -91,6 +92,15 @@ public static Microsoft.UI.Xaml.Application UseMauiEmbedding(this Microsof var mauiApp = mauiAppBuilder.Build(); mauiApp.InitializeMauiEmbeddingApp(app); + +#if WINDOWS + window.Activated += (s, args) => + { + WindowStateManager.Default.OnActivated(window, args); + }; +#endif + + #endif return app; } @@ -143,7 +153,7 @@ private static void InitializeApplicationMainPage(IApplication iApp) private static void SetCoreWindow(this IApplication app, Microsoft.Maui.Controls.Window window) { - if(app.Windows is List windows) + if (app.Windows is List windows) { windows.Add(window); } diff --git a/src/Uno.Extensions.Maui.UI/MauiEmbedding.windows.cs b/src/Uno.Extensions.Maui.UI/MauiEmbedding.windows.cs index a7ba5aa705..14858447f1 100644 --- a/src/Uno.Extensions.Maui.UI/MauiEmbedding.windows.cs +++ b/src/Uno.Extensions.Maui.UI/MauiEmbedding.windows.cs @@ -31,11 +31,6 @@ private static void InitializeMauiEmbeddingApp(this MauiApp mauiApp, Application throw new MauiEmbeddingException(Properties.Resources.TheApplicationMustInheritFromEmbeddingApplication); } - //if (_clone is not null) - //{ - // app.Resources.Merge(_clone); - //} - embeddingApp.InitializeApplication(mauiApp.Services, iApp); app.SetApplicationHandler(iApp, rootContext); InitializeApplicationMainPage(iApp);