public void Collapse() { if (!Current.IsEnabled || ExpandCollapseState != ExpandCollapseState.Expanded) { return; } if (FrameworkType == FrameworkType.WinForms) { // WinForms var openButton = FindFirstChild(ConditionFactory.ByControlType(ControlType.Button)).AsButton(); if (IsEditable) { // WinForms editable combo box only closes on click and not on invoke openButton.Click(); } else { openButton.Invoke(); } } else { // WPF var ecp = PatternFactory.GetExpandCollapsePattern(); ecp?.Collapse(); } Helpers.WaitUntilResponsive(this); }
public void Expand() { if (!Current.IsEnabled || ExpandCollapseState != ExpandCollapseState.Collapsed) { return; } if (FrameworkType == FrameworkType.WinForms) { // WinForms var openButton = FindFirstChild(ConditionFactory.ByControlType(ControlType.Button)).AsButton(); openButton.Invoke(); } else { // WPF var ecp = PatternFactory.GetExpandCollapsePattern(); if (ecp != null) { ecp.Expand(); Thread.Sleep(50); } } }