Example #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();
        }
Example #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();
        }
Example #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();
            }
        }
Example #4
0
 /// <summary>
 /// Hides the drop down.
 /// </summary>
 public void HideDropDown()
 {
     if (dropDown != null)
     {
         dropDown.Hide();
         DropDownClosed?.Invoke(this, EventArgs.Empty);
     }
 }
Example #5
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();
        }
Example #6
0
 protected virtual void OnDropDownClosed(object e)
 {
     DropDownClosed?.Invoke(this, null !);
 }
Example #7
0
 /// <summary>
 /// Raises the <see cref="DropDownClosed"/> event.
 /// </summary>
 protected virtual void OnDropDownClosed() =>
 DropDownClosed?.Invoke(this);
Example #8
0
 private void Popup_Closed(object sender, EventArgs e)
 {
     DropDownClosed?.Invoke(sender, new EventArgs());
 }
Example #9
0
 protected virtual void OnDropDownClosed(RoutedPropertyChangedEventArgs <bool> e)
 {
     DropDownClosed?.Invoke(this, e);
 }
Example #10
0
        /// <summary>
        /// Invoked when the DropDownClosed event is raised.
        /// </summary>
        /// <param name="e">Event data for the event.</param>
#if MIGRATION
        protected virtual void OnDropDownClosed(EventArgs e)
        {
            DropDownClosed?.Invoke(this, new RoutedPropertyChangedEventArgs <bool>(true, false));
        }
Example #11
0
 /// <summary>
 /// Raises the <see cref="DropDownClosed"/> 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="OnDropDownClosed"/> in a derived class, be sure to call the base class's
 /// <see cref="OnDropDownClosed"/> method so that registered delegates receive the event.
 /// </remarks>
 protected virtual void OnDropDownClosed(EventArgs eventArgs)
 {
     DropDownClosed?.Invoke(this, eventArgs);
 }