public KeyboardInsetTracker(UIScrollView targetView, Func <UIWindow> fetchWindow, Action <UIEdgeInsets> setInsetAction, Action <PointF> setContentOffset, IVisualElementRenderer renderer) { _setContentOffset = setContentOffset; _targetView = targetView; _fetchWindow = fetchWindow; _setInsetAction = setInsetAction; KeyboardObserver.KeyboardWillShow += OnKeyboardShown; KeyboardObserver.KeyboardWillHide += OnKeyboardHidden; if (renderer != null) { _shellScrollViewTracker = new ShellScrollViewTracker(renderer); } }
public void Dispose() { if (_disposed) { return; } _disposed = true; KeyboardObserver.KeyboardWillShow -= OnKeyboardShown; KeyboardObserver.KeyboardWillHide -= OnKeyboardHidden; _shellScrollViewTracker?.Dispose(); _shellScrollViewTracker = null; }