Ejemplo n.º 1
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__ || __MACOS__
            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.º 2
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.º 3
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.º 4
0
 /// <summary>
 /// Hides the drop down.
 /// </summary>
 public void HideDropDown()
 {
     if (dropDown != null)
     {
         dropDown.Hide();
         DropDownClosed?.Invoke(this, EventArgs.Empty);
     }
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 6
0
 protected virtual void OnDropDownClosed(object e)
 {
     DropDownClosed?.Invoke(this, null !);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Raises the <see cref="DropDownClosed"/> event.
 /// </summary>
 protected virtual void OnDropDownClosed() =>
 DropDownClosed?.Invoke(this);
Ejemplo n.º 8
0
 private void Popup_Closed(object sender, EventArgs e)
 {
     DropDownClosed?.Invoke(sender, new EventArgs());
 }
Ejemplo n.º 9
0
 protected virtual void OnDropDownClosed(RoutedPropertyChangedEventArgs <bool> e)
 {
     DropDownClosed?.Invoke(this, e);
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
 }