private void ViewTreeObserver_GlobalFocusChange(object sender, ViewTreeObserver.GlobalFocusChangeEventArgs e) { int[] screenLocation = new int[2]; e.NewFocus.GetLocationInWindow(screenLocation); clickYPosition = screenLocation[1]; }
private void ViewTreeObserver_GlobalFocusChange(object sender, ViewTreeObserver.GlobalFocusChangeEventArgs e) { if (e.NewFocus != Card && e.NewFocus != Label && e.NewFocus != Image && e.NewFocus != EditText && e.NewFocus != EditTextLayout) { if (string.IsNullOrWhiteSpace(EditText.Text)) { Reduce(); } } }
private void OnViewTreeObserverOnGlobalFocusChange(object sender, ViewTreeObserver.GlobalFocusChangeEventArgs args) { if (args.NewFocus == null) { _viewWithLastFocus = null; return; } if (args.NewFocus != ListView) { //check if it's one of our's var parent = args.NewFocus.Parent; while (parent != null && parent != parent.Parent) { if (parent == ListView) { _viewWithLastFocus = args.NewFocus; break; } parent = parent.Parent; } } }