partial void OnFocusStateChangedPartial(FocusState focusState) { if (_textBoxView == null) { return; } if (focusState == FocusState.Unfocused) { if (_textBoxView.IsFocused) { _textBoxView.ClearFocus(); } } else { if (!_textBoxView.IsFocused) { using (focusState == FocusState.Programmatic ? PreventKeyboardDisplayIfSet() : null) { _textBoxView.RequestFocus(); } } } }
partial void OnFocusStateChangedPartial(FocusState focusState) { if (_textBoxView == null) { return; } if (focusState == FocusState.Unfocused) { if (_textBoxView.IsFocused) { _textBoxView.ClearFocus(); } } else { if (!_textBoxView.IsFocused) { using (focusState == FocusState.Programmatic ? PreventKeyboardDisplayIfSet() : null) { _textBoxView.RequestFocus(); var selectionStart = this.SelectionStart; if (selectionStart == 0) { int cursorPosition = selectionStart + _textBoxView?.Text?.Length ?? 0; this.Select(cursorPosition, 0); } } } } }