public static void Focus(this AView platformView, FocusRequest request) { request.IsFocused = true; // Android does the actual focus/unfocus work on the main looper // So in case we're setting the focus in response to another control's un-focusing, // we need to post the handling of it to the main looper so that it happens _after_ all the other focus // work is done; otherwise, a call to ClearFocus on another control will kill the focus we set var q = Looper.MyLooper(); if (q != null) { new Handler(q).Post(RequestFocus); } else { MainThread.InvokeOnMainThreadAsync(RequestFocus); } void RequestFocus() { if (platformView == null || platformView.IsDisposed()) { return; } platformView?.RequestFocus(); } }
public void newFocusRequest(int applicationId) { focusRequestCount++; var request = new FocusRequest(focusRequestCount, applicationId); focusRequests.Enqueue(request); }
public static ICommand RequestFocus(this IEditor editor, FocusKind value, Point?location) { var req = new FocusRequest(); req.Value = value; req.Location = location; return(editor.PerformRequest(req)); }
public static void Focus(this AView platformView, FocusRequest request) { // Android does the actual focus/unfocus work on the main looper // So in case we're setting the focus in response to another control's un-focusing, // we need to post the handling of it to the main looper so that it happens _after_ all the other focus // work is done; otherwise, a call to ClearFocus on another control will kill the focus we set here MainThread.BeginInvokeOnMainThread(() => { if (platformView == null || platformView.IsDisposed()) { return; } platformView?.RequestFocus(); }); }
private void SetText(IEnumerable <TwitterAccount> infos, string body, TwitterStatus inReplyTo, CursorPosition cursor, bool focusToInputArea) { CurrentInputData = new InputData(body) { Accounts = infos, InReplyTo = inReplyTo, }; SetCursorRequest.SafeInvoke(cursor ?? CursorPosition.End); if (focusToInputArea) { FocusRequest.SafeInvoke(); } }
private void SetDirectMessage(IEnumerable <TwitterAccount> infos, [NotNull] TwitterUser recipient, bool focusToInputArea) { if (recipient == null) { throw new ArgumentNullException("recipient"); } CurrentInputData = new InputData(String.Empty) { Accounts = infos, MessageRecipient = recipient }; // because text is always empty, setting cursor position can be skipped. if (focusToInputArea) { FocusRequest.SafeInvoke(); } }
private void SetFocus(FocusRequest req) { switch (req) { case FocusRequest.Search: SearchFlipViewModel.FocusToSearchBox(); break; case FocusRequest.Timeline: SearchFlipViewModel.Close(); var ctab = TabManager.CurrentFocusTab; if (ctab != null) { ctab.RequestFocus(); } break; case FocusRequest.Input: SearchFlipViewModel.Close(); this.InputViewModel.OpenInput(); this.InputViewModel.FocusToTextBox(); break; } }
private void SetFocus(FocusRequest req) { switch (req) { case FocusRequest.Search: SearchFlipViewModel.FocusToSearchBox(); break; case FocusRequest.Timeline: TabManager.CurrentFocusTab.RequestFocus(); SearchFlipViewModel.Close(); break; case FocusRequest.Input: InputAreaViewModel.OpenInput(); InputAreaViewModel.FocusToTextBox(); SearchFlipViewModel.Close(); break; } }
private static void SetEventPropagation() { _core.SetCursorRequest += arg => SetCursorRequest.SafeInvoke(arg); _core.FocusRequest += () => FocusRequest.SafeInvoke(); _core.CloseRequest += () => CloseRequest.SafeInvoke(); }
public static void SetFocusTo(FocusRequest req) { FocusRequested.SafeInvoke(req); }
public static void Focus(this FrameworkElement platformView, FocusRequest request) { // TODO: Implement Focus on Windows. }
public static void Focus(this UIView platformView, FocusRequest request) { platformView.BecomeFirstResponder(); }
public static void Focus(this object platformView, FocusRequest request) { }
public static void SetFocusTo(FocusRequest req) { var handler = FocusRequested; if (handler != null) handler(req); }
public static void Focus(this EvasObject platformView, FocusRequest request) { // TODO: Implement Focus on Tizen (ref #4588) }
public static void Focus(this FrameworkElement platformView, FocusRequest request) { request.IsFocused = platformView.Focus(FocusState.Programmatic); }