public void SetOnViewAttachListener(OnViewAttachListener listener) { this.listener?.OnDetach(); this.listener = listener; if (ViewCompat.IsAttachedToWindow(view)) { listener?.OnAttach(); } }
/// <summary> /// Sets the on view attach listener. /// </summary> /// <param name="listener">The listener.</param> public void SetOnViewAttachListener(IOnViewAttachListener listener) { if (_listener != null) { _listener.OnDetach(); } _listener = listener; if (ViewCompat.IsAttachedToWindow(_view) && listener != null) { listener.OnAttach(); } }