Ejemplo n.º 1
0
        partial void OnIsDropDownOpenChangedPartial(bool oldIsDropDownOpen, bool newIsDropDownOpen)
        {
            if (_popup != null)
            {
                _popup.IsOpen = newIsDropDownOpen;
            }

            if (newIsDropDownOpen)
            {
                DropDownOpened?.Invoke(this, newIsDropDownOpen);

                RestoreSelectedItem();

                if (SelectedItem != null)
                {
                    ScrollIntoView(SelectedItem);
                }
            }
            else
            {
                DropDownClosed?.Invoke(this, newIsDropDownOpen);
                UpdateContentPresenter();
            }

            UpdateDropDownState();
        }
Ejemplo n.º 2
0
        partial void OnIsDropDownOpenChangedPartial(bool oldIsDropDownOpen, bool newIsDropDownOpen)
        {
            // This method will load the itempresenter children
#if __ANDROID__
            SetItemsPresenter((_popup.Child as ViewGroup).FindFirstChild <ItemsPresenter>());
#elif __IOS__
            SetItemsPresenter(_popup.Child.FindFirstChild <ItemsPresenter>());
#endif

            if (_popup != null)
            {
                _popup.IsOpen = newIsDropDownOpen;
            }

            if (newIsDropDownOpen)
            {
                DropDownOpened?.Invoke(this, newIsDropDownOpen);

                RestoreSelectedItem();

                if (SelectedItem != null)
                {
                    ScrollIntoView(SelectedItem);
                }
            }
            else
            {
                DropDownClosed?.Invoke(this, newIsDropDownOpen);
                UpdateContentPresenter();
            }

            UpdateDropDownState();
        }
Ejemplo n.º 3
0
        partial void OnIsDropDownOpenChangedPartial(bool oldIsDropDownOpen, bool newIsDropDownOpen)
        {
            var(_, popupChild) = LayoutPopup();

            if (_popup != null)
            {
                _popup.IsOpen = newIsDropDownOpen;
            }

            if (newIsDropDownOpen)
            {
                DropDownOpened?.Invoke(this, newIsDropDownOpen);
                if (popupChild != null)
                {
                    popupChild.SizeChanged += PopupChildChanged;
                }
            }
            else
            {
                if (popupChild != null)
                {
                    popupChild.SizeChanged -= PopupChildChanged;
                }
                DropDownClosed?.Invoke(this, newIsDropDownOpen);
            }

            UpdateDropDownState();

            void PopupChildChanged(object snd, SizeChangedEventArgs evt)
            {
                LayoutPopup();
            }
        }
Ejemplo n.º 4
0
        partial void OnIsDropDownOpenChangedPartial(bool oldIsDropDownOpen, bool newIsDropDownOpen)
        {
            if (_popup != null)
            {
                _popup.IsOpen = newIsDropDownOpen;
            }

            if (newIsDropDownOpen)
            {
                DropDownOpened?.Invoke(this, newIsDropDownOpen);
            }
            else
            {
                DropDownClosed?.Invoke(this, newIsDropDownOpen);
            }

            UpdateDropDownState();
        }
Ejemplo n.º 5
0
 protected virtual void OnDropDownOpened(object e)
 {
     DropDownOpened?.Invoke(this, null !);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Raises the <see cref="DropDownOpened"/> event.
 /// </summary>
 protected virtual void OnDropDownOpened() =>
 DropDownOpened?.Invoke(this);
Ejemplo n.º 7
0
 private void Popup_Opened(object sender, EventArgs e)
 {
     SearchText = string.Empty;
     scrollFlag = false;
     DropDownOpened?.Invoke(sender, new EventArgs());
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Raises the <see cref="DropDownOpened"/> event.
 /// </summary>
 /// <param name="eventArgs">
 /// <see cref="EventArgs"/> object that provides the arguments for the event.
 /// </param>
 /// <remarks>
 /// <strong>Notes to Inheritors:</strong><br/>
 /// When overriding <see cref="OnDropDownOpened"/> in a derived class, be sure to call the base class's
 /// <see cref="OnDropDownOpened"/> method so that registered delegates receive the event.
 /// </remarks>
 protected virtual void OnDropDownOpened(EventArgs eventArgs)
 {
     DropDownOpened?.Invoke(this, eventArgs);
 }
Ejemplo n.º 9
0
 private void RaiseDropDownOpened()
 {
     DropDownOpened?.Invoke(this, EventArgs.Empty);
 }