I want to hide software buttons when enter text to entry is done. When user put finger outside keyboard, this method is invoked:

```
 public override void OnUserInteraction()
        {
            base.OnUserInteraction();
            HideSoftwareMenuBars();
        }

```

That works perfectly:

```
 private void HideSoftwareMenuBars()
        {
            try
            {
                int uiOptions = (int)Window.DecorView.SystemUiVisibility;
                uiOptions |= (int)SystemUiFlags.LayoutStable;
                uiOptions |= (int)SystemUiFlags.LayoutHideNavigation;
                uiOptions |= (int)SystemUiFlags.LayoutFullscreen;
                uiOptions |= (int)SystemUiFlags.LowProfile;
                uiOptions |= (int)SystemUiFlags.HideNavigation;
                uiOptions |= (int)SystemUiFlags.Fullscreen;
                uiOptions |= (int)SystemUiFlags.ImmersiveSticky;
                this.Window.DecorView.SystemUiVisibility = (StatusBarVisibility)uiOptions;
            }
            catch (System.Exception Ex)
            {
            }
        }

```

But there is no method in MainActivity.cs to override that is being called when user press "enter" key on keyboard. I have overridden more than 200 methods to check it. Then in Xamarin.Forms in code behind I have event:

```
private void Entry_Unfocused(object sender, FocusEventArgs e)
        {
            DependencyService.Get<ISoftwareButtons>().HideSoftwareMenuBars();
        }

```

Then by calling dependency interface, here I have 2 errors:

```
[assembly: Dependency(typeof(SoftwareButtonsHandler))]
namespace Channel.Droid.DependencyHandlers
{
    public class SoftwareButtonsHandler
    {
        private void HideSoftwareMenuBars()
        {
            try
            {
                int uiOptions = (int) Window.DecorView.SystemUiVisibility;
                uiOptions |= (int)SystemUiFlags.LayoutStable;
                uiOptions |= (int)SystemUiFlags.LayoutHideNavigation;
                uiOptions |= (int)SystemUiFlags.LayoutFullscreen;
                uiOptions |= (int)SystemUiFlags.LowProfile;
                uiOptions |= (int)SystemUiFlags.HideNavigation;
                uiOptions |= (int)SystemUiFlags.Fullscreen;
                uiOptions |= (int)SystemUiFlags.ImmersiveSticky;
                this.Window.DecorView.SystemUiVisibility = (StatusBarVisibility)uiOptions;
            }
            catch (System.Exception Ex)
            {
            }
        }
    }
}

```

The problem is that "Window.Devorview" has errors: 

> 
> "Abstract base class for a top-level window look and behaviour policy.
>  An object reference is required for the non-static field, method, or
>  property 'Window.DecorView;"
> 
> 
> 

and "this.Window"

> 
> "SoftwareButtonsHandler' does not contain definition for 'Window' and
>  no accessible extension method 'Window' accepting a first argument of
>  type 'SoftwareButtonsHandler' could be found (are you missing a using
>  directive or an assembly reference?"
> 
> 
> 

Is there a way to call MainActivity.cs's method from another class or get necessary "Window" in dependency handler (that is accessible only in MainActivity.cs) ?