Plugin.Maui.ScreenSecurity
Plugin.Maui.ScreenSecurity copied to clipboard
protection not working if declared ScreenSecurity.Default.ActivateScreenSecurityProtection() globally, working only with MainPage.xaml.cs file
I want to restrict screen sharing, screen recording & screenshot capturing from all the pages of my .NET MAUI application. I tried to use Plugin.Maui.ScreenSecurity.
I observed it's working if we add it MainPage.xaml.cs file. I tried to apply it globally as below.
In App.xaml.cs file
public App()
{
InitializeComponent();
ScreenSecurity.Default.ActivateScreenSecurityProtection();
MainPage = new AppShell();
}
Also tried in CreateMauiApp() in MauiProgram.cs file as below
var app = builder.Build();
ScreenSecurity.Default.ActivateScreenSecurityProtection();
return app;
None seems to be working if applied globally as above. Is this a bug or any other way to apply it globally at one place?