fix dropdown scroll fokus
This commit is contained in:
@@ -176,20 +176,39 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
}
|
||||
}
|
||||
|
||||
private void DropDownClosed(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!(sender is FrameworkElement senderElement))
|
||||
return;
|
||||
ErrorTypeValueChanged?.Invoke(this, EventArgs.Empty);
|
||||
var parentBorder = cUiElementHelper.GetFirstParentOfType<Border>(senderElement);
|
||||
cFocusInvoker.InvokeLostFocus(parentBorder, e);
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
private void DropDownClosed(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!(sender is FrameworkElement senderElement))
|
||||
return;
|
||||
ErrorTypeValueChanged?.Invoke(this, EventArgs.Empty);
|
||||
var parentBorder = cUiElementHelper.GetFirstParentOfType<Border>(senderElement);
|
||||
cFocusInvoker.InvokeLostFocus(parentBorder, e);
|
||||
|
||||
_ = Dispatcher.BeginInvoke((Action)(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var parentScrollViewer = cUiElementHelper.GetFirstParentOfType<ScrollViewer>(this);
|
||||
Keyboard.ClearFocus();
|
||||
|
||||
if (parentScrollViewer != null)
|
||||
{
|
||||
parentScrollViewer.Focus();
|
||||
Keyboard.Focus(parentScrollViewer);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
LogException(exception);
|
||||
}
|
||||
}), System.Windows.Threading.DispatcherPriority.Input);
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user