diff --git a/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs b/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs index 85d8c54bb4..55e5b09c92 100644 --- a/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs +++ b/samples/MauiEmbedding/MauiEmbedding.MauiControls/SyncfusionDemoPage.xaml.cs @@ -5,5 +5,15 @@ public partial class SyncfusionDemoPage : ContentPage public SyncfusionDemoPage() { InitializeComponent(); + + Loaded += SyncfusionDemoPage_Loaded; + } + + 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/Directory.Build.props b/src/Directory.Build.props index d380544ac2..8d9d23f88f 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -22,6 +22,8 @@ true true + + True diff --git a/src/Uno.Extensions.Core.Generators/buildTransitive/Uno.Extensions.Core.props b/src/Uno.Extensions.Core.Generators/buildTransitive/Uno.Extensions.Core.props index 430be83525..ff09f76930 100644 --- a/src/Uno.Extensions.Core.Generators/buildTransitive/Uno.Extensions.Core.props +++ b/src/Uno.Extensions.Core.Generators/buildTransitive/Uno.Extensions.Core.props @@ -1,12 +1,20 @@ - - - + + + + + - + + + + + + + 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); diff --git a/src/Uno.Extensions.Maui.UI/MauiHost.cs b/src/Uno.Extensions.Maui.UI/MauiHost.cs index c9b0c0e59a..f4cdb5e9bd 100644 --- a/src/Uno.Extensions.Maui.UI/MauiHost.cs +++ b/src/Uno.Extensions.Maui.UI/MauiHost.cs @@ -49,7 +49,7 @@ dependencyObject is not MauiHost mauiHost || if(instance is VisualElement visualElement) { mauiHost.VisualElement = visualElement; - visualElement.Parent = app; + visualElement.Parent = app.Windows[0]; visualElement.BindingContext = mauiHost.DataContext; } else