Skip to content

Commit 4423e40

Browse files
Joe ShookJoe Shook
authored andcommitted
Extract everything that has to do with Maui from the Razor Class Library
1 parent 7aee4b2 commit 4423e40

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#if WINDOWS
2+
using WinUIEx;
3+
#endif
4+
using UdapEd.Shared.Services;
5+
6+
namespace UdapEdAppMaui.Services;
7+
8+
public sealed class MainPageService : IMainPageService
9+
{
10+
public void BringToFront()
11+
{
12+
#if WINDOWS
13+
var mauiWindow = Application.Current?.Windows.FirstOrDefault();
14+
var window = mauiWindow?.Handler?.PlatformView as Microsoft.UI.Xaml.Window;
15+
window?.SetForegroundWindow();
16+
#endif
17+
// No-op on other platforms
18+
}
19+
}

0 commit comments

Comments
 (0)