fix dropdown scroll fokus
This commit is contained in:
@@ -271,14 +271,15 @@
|
||||
SelectedInternIcon="status_bad"
|
||||
VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
<local:ComboBoxPageable x:Name="ServiceSelectionControl"
|
||||
Margin="0 5 0 0"
|
||||
ResetFilterLabel="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ResetFilter.Services}"
|
||||
SelectedItem="{Binding SelectedService, ElementName=CloseCaseDialogUc, Mode=TwoWay}"
|
||||
IsEnabled="{Binding SetOrUpdateServiceInTicket, ElementName=CloseCaseDialogUc}"
|
||||
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}"
|
||||
PreviewKeyDown="Combobox_PreviewKeyDown" />
|
||||
<local:ComboBoxPageable x:Name="ServiceSelectionControl"
|
||||
Margin="0 5 0 0"
|
||||
ResetFilterLabel="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ResetFilter.Services}"
|
||||
SelectedItem="{Binding SelectedService, ElementName=CloseCaseDialogUc, Mode=TwoWay}"
|
||||
IsEnabled="{Binding SetOrUpdateServiceInTicket, ElementName=CloseCaseDialogUc}"
|
||||
RestoreParentScrollFocusOnDropDownClose="True"
|
||||
ComboBoxBackground="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}"
|
||||
BorderBrush="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}"
|
||||
PreviewKeyDown="Combobox_PreviewKeyDown" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
|
||||
@@ -2745,13 +2745,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
if (parentBorder != null)
|
||||
cFocusInvoker.InvokeLostFocus(parentBorder, e);
|
||||
|
||||
if (ReferenceEquals(sender, TicketStatusCombobox))
|
||||
{
|
||||
_ = Dispatcher.BeginInvoke(new Action(RestoreDialogFocusAfterTicketActionSelection), System.Windows.Threading.DispatcherPriority.Input);
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicStatusAdditionBorder?.Focus();
|
||||
_ = Dispatcher.BeginInvoke(new Action(RestoreDialogFocusAfterTicketActionSelection), System.Windows.Threading.DispatcherPriority.Input);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
Style="{StaticResource MandatoryFieldBorderStyle}">
|
||||
<local:ComboBoxPageable x:Name="RoleSelectionControl"
|
||||
SelectedItem="{Binding ElementName=ForwardTicketDialogUc, Path=SelectedRole, Mode=TwoWay}"
|
||||
RestoreParentScrollFocusOnDropDownClose="True"
|
||||
ComboBoxBackground="{Binding Background, RelativeSource={RelativeSource AncestorType=Border}}"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="0" />
|
||||
@@ -38,6 +39,7 @@
|
||||
Style="{StaticResource MandatoryFieldBorderStyle}">
|
||||
<local:ComboBoxPageable x:Name="PersonSelectionControl"
|
||||
SelectedItem="{Binding ElementName=ForwardTicketDialogUc, Path=SelectedPerson, Mode=TwoWay}"
|
||||
RestoreParentScrollFocusOnDropDownClose="True"
|
||||
ComboBoxBackground="{Binding Background, RelativeSource={RelativeSource AncestorType=Border}}"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="0" />
|
||||
|
||||
@@ -252,20 +252,39 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
}
|
||||
}
|
||||
|
||||
private void DropDownClosed(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!(sender is FrameworkElement senderElement))
|
||||
return;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
Reference in New Issue
Block a user