Пример #1
0
        public bool DetachWithIME()
        {
            if (CanDetachWithIME())
            {
                if (IsVisible)
                {
                    if (IsXAML)
                    {
                        // Let's try to get rid of the soft keyboard.  Really weird workaround finally found to keep
                        // the keyboard hidden without adding a Button control as well and switching focus to it.
                        // Found solution here:
                        // http://stackoverflow.com/questions/10714431/how-to-hide-on-edittext-soft-keyboard-windows-8-metro-application
                        // When the textbox that showed the virtual keyboard has it’s propery IsEnabled set to false, the virtual keyboard
                        // disappears. We can immediately set is to true after that and the virtual keyboard will remain hidden.
                        hiddenKeyInput.IsEnabled = false;
                        hiddenKeyInput.IsEnabled = true;

                        // Let's do the ReadOnly = true just to make sure
                        hiddenKeyInput.IsReadOnly = true;
                    }
                    else
                    {
                        IsVisible = false;
                        OnKeyboardWillHide();
                        TextFieldInFocus.RemoveEventListener(keyboardListener);
                        OnKeyboardDidHide();
                    }
                }
            }
            return(true);
        }
 public bool DetachWithIME()
 {
     if (CanDetachWithIME())
     {
         if (IsVisible)
         {
             IsVisible = false;
             OnKeyboardWillHide();
             TextFieldInFocus.RemoveEventListener(keyboardListener);
             OnKeyboardDidHide();
         }
     }
     return(true);
 }