Plugin.Maui.ScreenSecurity icon indicating copy to clipboard operation
Plugin.Maui.ScreenSecurity copied to clipboard

protection not working if declared ScreenSecurity.Default.ActivateScreenSecurityProtection() globally, working only with MainPage.xaml.cs file

Open chandu15x opened this issue 2 months ago • 1 comments

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?

chandu15x avatar Apr 26 '24 02:04 chandu15x