コード例 #1
0
 public void SetOnViewAttachListener(OnViewAttachListener listener)
 {
     this.listener?.OnDetach();
     this.listener = listener;
     if (ViewCompat.IsAttachedToWindow(view))
     {
         listener?.OnAttach();
     }
 }
コード例 #2
0
 /// <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();
     }
 }