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