public bool OnPressed(KeyBindingPressEvent <GlobalAction> e) { switch (e.Action) { case GlobalAction.Back: if (Textbox.HasFocus) { Schedule(() => Textbox.KillFocus()); return(true); } break; case GlobalAction.ToggleChatFocus: if (Textbox.HasFocus) { Schedule(() => Textbox.KillFocus()); } else { expandedFromTextboxFocus.Value = true; // schedule required to ensure the textbox has become present from above bindable update. Schedule(() => Textbox.TakeFocus()); } return(true); } return(false); }