Skip to content

Commit

Permalink
fix: Registering for activation - required to set displayinformation …
Browse files Browse the repository at this point in the history
…from window

(cherry picked from commit e1cb19b)
  • Loading branch information
nickrandolph authored and mergify[bot] committed Aug 29, 2023
1 parent 9a62745 commit 76b031d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
12 changes: 11 additions & 1 deletion src/Uno.Extensions.Maui.UI/MauiEmbedding.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Maui.ApplicationModel;
using Uno.Extensions.Hosting;

namespace Uno.Extensions.Maui;
Expand Down Expand Up @@ -91,6 +92,15 @@ public static Microsoft.UI.Xaml.Application UseMauiEmbedding<TApp>(this Microsof

var mauiApp = mauiAppBuilder.Build();
mauiApp.InitializeMauiEmbeddingApp(app);

#if WINDOWS
window.Activated += (s, args) =>
{
WindowStateManager.Default.OnActivated(window, args);
};
#endif


#endif
return app;
}
Expand Down Expand Up @@ -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<Microsoft.Maui.Controls.Window> windows)
if (app.Windows is List<Microsoft.Maui.Controls.Window> windows)
{
windows.Add(window);
}
Expand Down
5 changes: 0 additions & 5 deletions src/Uno.Extensions.Maui.UI/MauiEmbedding.windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 76b031d

Please sign in to comment.