Skip to content

Commit 267aaf7

Browse files
committed
clean
1 parent 2af7022 commit 267aaf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/iNKORE.UI.WPF.Modern/Controls/Helpers/ComboBoxHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private static void UpdateCornerRadius(ComboBox comboBox, bool isDropDownOpen)
114114
if (isDropDownOpen)
115115
{
116116
var popup = GetTemplateChild<System.Windows.Controls.Primitives.Popup>("PART_Popup", comboBox);
117-
bool isOpenDown = GetPopupVerticalOffset(comboBox) > popup.VerticalOffset;
117+
bool isOpenDown = IsPopupOpenDown(comboBox, popup.VerticalOffset);
118118

119119
if (isOpenDown &&
120120
comboBox.ItemContainerGenerator.ContainerFromItem(comboBox.SelectedItem) is FrameworkElement itemContainer &&
@@ -164,9 +164,9 @@ private static CornerRadius GetFilteredPopupRadius(CornerRadius popupRadius, boo
164164
return CornerRadiusFilterConverter.Convert(popupRadius, popupRadiusFilter);
165165
}
166166

167-
private static double GetPopupVerticalOffset(ComboBox comboBox)
167+
private static bool IsPopupOpenDown(ComboBox comboBox, double popupVerticalOffset)
168168
{
169-
double verticalOffset = 0;
169+
double verticalOffset = popupVerticalOffset;
170170
if (GetTemplateChild<Border>(c_popupBorderName, comboBox) is Border popupBorder)
171171
{
172172
if (GetTemplateChild<TextBox>(c_editableTextName, comboBox) is TextBox textBox)
@@ -175,7 +175,7 @@ private static double GetPopupVerticalOffset(ComboBox comboBox)
175175
verticalOffset = popupTop.Y;
176176
}
177177
}
178-
return verticalOffset;
178+
return verticalOffset > popupVerticalOffset;
179179
}
180180

181181
private static object ResourceLookup(Control control, object key)

0 commit comments

Comments
 (0)