You don't have to use the WeakReferenceMessenger. You can use the conditional compilation instead of it.
#if ANDROIDusing Android.Views;#endif ... protected override void OnAppearing() { base.OnAppearing();#if ANDROID Platform.CurrentActivity.Window.DecorView.SystemUiVisibility = (StatusBarVisibility) (SystemUiFlags.ImmersiveSticky | SystemUiFlags.HideNavigation | SystemUiFlags.Fullscreen | SystemUiFlags.Immersive);#endif } protected override void OnDisappearing() { base.OnDisappearing();#if ANDROID Platform.CurrentActivity.Window.DecorView.SystemUiVisibility = (StatusBarVisibility) (SystemUiFlags.Visible | SystemUiFlags.Visible | SystemUiFlags.Immersive);#endif }
In additio, the systemuivisibility was deprecated, you can use Platform.CurrentActivity.Window.InsetsController.Hide( WindowInsets.Type.SystemBars());
to hide the system bars and use the Platform.CurrentActivity.Window.InsetsController.Show( WindowInsets.Type.SystemBars() );
to show them.