-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppShell.xaml.cs
36 lines (30 loc) · 900 Bytes
/
AppShell.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Platform;
#if WINDOWS
using Microsoft.UI.Xaml.Controls;
#endif
namespace MicaBackdropMAUI;
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
this.Loaded += (_, _) => {
OverrideBg();
};
}
internal void OverrideBg()
{
#if WINDOWS
var shellView = Shell.Current?.Handler?.PlatformView as ShellView;
var navigationView = shellView?.Content as MauiNavigationView;
var contentGrid = navigationView?
.GetType()
.GetProperty("ContentGrid",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance)?
.GetValue(navigationView) as Microsoft.UI.Xaml.Controls.Grid;
contentGrid!.Background.Opacity = 0;
#endif
}
}