protected override void OnAttached() { _nextView = null; switch (_direction) { case FocusDirection.Up: _nextView = Focus.GetUp(Element); break; case FocusDirection.Down: _nextView = Focus.GetDown(Element); break; case FocusDirection.Left: _nextView = Focus.GetLeft(Element); break; case FocusDirection.Right: _nextView = Focus.GetRight(Element); break; default: _nextView = null; break; } if (_nextView != null) { if (_nextView.IsPlatformEnabled) { SetCustomFocus(Control, _nextView, _direction); } else { _nextView.PropertyChanged += OnNextViewPropertyChanged; } } else { (Control as Widget)?.SetNextFocusObject(null, _direction); } }