Kategorie

This commit is contained in:
Meik
2025-11-11 20:22:10 +01:00
parent 05fb34815a
commit 8cf1c84328
2 changed files with 14 additions and 30 deletions

View File

@@ -2392,25 +2392,23 @@ namespace FasdDesktopUi.Basics.UserControls
#region DropDown
private static bool IsInsidePageable(FrameworkElement fe)
{
return cUiElementHelper.GetFirstParentOfType<ComboBoxPageable>(fe) != null;
}
private static bool IsInsidePageable(FrameworkElement fe) => cUiElementHelper.GetFirstParentOfType<ComboBoxPageable>(fe) != null;
private static bool IsHierarchicalControl(FrameworkElement fe) => fe is HierarchicalSelectionControl;
private void DropDownOpened(object sender, EventArgs e)
{
if (!(sender is FrameworkElement fe)) return;
if (IsInsidePageable(fe)) return; // ComboBoxPageable macht das selbst
var parentBorder = cUiElementHelper.GetFirstParentOfType<Border>(fe);
if (parentBorder != null)
if (!(sender is FrameworkElement fe)) return;
if (IsInsidePageable(fe) || IsHierarchicalControl(fe)) return; // Spezialfälle handeln Fokus selbst
var parentBorder = cUiElementHelper.GetFirstParentOfType<Border>(fe);
if (parentBorder != null)
cFocusInvoker.InvokeGotFocus(parentBorder, e);
}
private void DropDownClosed(object sender, EventArgs e)
{
if (!(sender is FrameworkElement fe)) return;
if (IsInsidePageable(fe)) return;
if (!(sender is FrameworkElement fe)) return;
if (IsInsidePageable(fe) || IsHierarchicalControl(fe)) return;
var parentBorder = cUiElementHelper.GetFirstParentOfType<Border>(fe);
if (parentBorder != null)