Compare commits
7 Commits
e6968e29eb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f2c3fefc1 | ||
|
|
1b9a1260f0 | ||
|
|
1215cadd6c | ||
|
|
485a209a26 | ||
|
|
e154353af8 | ||
|
|
234eacaecf | ||
|
|
dd0e7bdc99 |
@@ -222,6 +222,15 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CloseDropDownIfOpen()
|
||||||
|
{
|
||||||
|
if (ComboBoxControl?.IsDropDownOpen != true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ComboBoxControl.IsDropDownOpen = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#region Paging Events
|
#region Paging Events
|
||||||
|
|
||||||
#region PageBack
|
#region PageBack
|
||||||
@@ -316,6 +325,15 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SearchTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key != Key.Escape)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (CloseDropDownIfOpen())
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
private void ComboBoxControl_DropDownClosed(object sender, EventArgs e)
|
private void ComboBoxControl_DropDownClosed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
@@ -384,6 +402,8 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
TextBox searchTextBox = FindVisualChild<TextBox>(partPopup.Child, "SearchTextBox");
|
TextBox searchTextBox = FindVisualChild<TextBox>(partPopup.Child, "SearchTextBox");
|
||||||
if (searchTextBox != null)
|
if (searchTextBox != null)
|
||||||
{
|
{
|
||||||
|
searchTextBox.PreviewKeyDown -= SearchTextBox_PreviewKeyDown;
|
||||||
|
searchTextBox.PreviewKeyDown += SearchTextBox_PreviewKeyDown;
|
||||||
// Setzen des Fokus auf TextBox
|
// Setzen des Fokus auf TextBox
|
||||||
searchTextBox.Focus();
|
searchTextBox.Focus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,15 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
searchDelayTimer.Tick += SearchDelayTimer_Tick;
|
searchDelayTimer.Tick += SearchDelayTimer_Tick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CloseDropDownIfOpen()
|
||||||
|
{
|
||||||
|
if (ComboBoxControl?.IsDropDownOpen != true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ComboBoxControl.IsDropDownOpen = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnApplyTemplate()
|
public override void OnApplyTemplate()
|
||||||
{
|
{
|
||||||
base.OnApplyTemplate();
|
base.OnApplyTemplate();
|
||||||
@@ -345,6 +354,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
if (treeViewControl != null)
|
if (treeViewControl != null)
|
||||||
{
|
{
|
||||||
treeViewControl.SelectedItemChanged += TreeViewControl_SelectedItemChanged;
|
treeViewControl.SelectedItemChanged += TreeViewControl_SelectedItemChanged;
|
||||||
|
treeViewControl.PreviewKeyDown += DropDownContent_PreviewKeyDown;
|
||||||
treeViewControl.ItemsSource = VisibleItems;
|
treeViewControl.ItemsSource = VisibleItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -353,7 +363,10 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
{
|
{
|
||||||
searchTextBox = ComboBoxControl.Template.FindName("PART_SearchTextBox", ComboBoxControl) as TextBox;
|
searchTextBox = ComboBoxControl.Template.FindName("PART_SearchTextBox", ComboBoxControl) as TextBox;
|
||||||
if (searchTextBox != null)
|
if (searchTextBox != null)
|
||||||
|
{
|
||||||
searchTextBox.TextChanged += SearchTextBox_TextChanged;
|
searchTextBox.TextChanged += SearchTextBox_TextChanged;
|
||||||
|
searchTextBox.PreviewKeyDown += DropDownContent_PreviewKeyDown;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemsScrollViewer == null)
|
if (itemsScrollViewer == null)
|
||||||
@@ -399,6 +412,15 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DropDownContent_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key != Key.Escape)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (CloseDropDownIfOpen())
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Keyboard
|
#region Keyboard
|
||||||
|
|||||||
@@ -167,7 +167,9 @@
|
|||||||
<Border Background="{DynamicResource BackgroundColor.DetailsPage.Widget.Title}"
|
<Border Background="{DynamicResource BackgroundColor.DetailsPage.Widget.Title}"
|
||||||
CornerRadius="7.5"
|
CornerRadius="7.5"
|
||||||
Width="{Binding ElementName=TicketSelectionBorder, Path=ActualWidth}">
|
Width="{Binding ElementName=TicketSelectionBorder, Path=ActualWidth}">
|
||||||
<StackPanel x:Name="TicketSelectionContainer" />
|
<StackPanel x:Name="TicketSelectionContainer"
|
||||||
|
Focusable="True"
|
||||||
|
PreviewKeyDown="TicketSelectionContainer_PreviewKeyDown" />
|
||||||
</Border>
|
</Border>
|
||||||
</Popup>
|
</Popup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -2541,6 +2541,14 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
DropDownOpened(TicketSelectionBorder, EventArgs.Empty);
|
DropDownOpened(TicketSelectionBorder, EventArgs.Empty);
|
||||||
|
|
||||||
TicketSelectionPopUp.IsOpen = !TicketSelectionPopUp.IsOpen;
|
TicketSelectionPopUp.IsOpen = !TicketSelectionPopUp.IsOpen;
|
||||||
|
if (TicketSelectionPopUp.IsOpen)
|
||||||
|
{
|
||||||
|
_ = Dispatcher.BeginInvoke((Action)(() =>
|
||||||
|
{
|
||||||
|
TicketSelectionContainer?.Focus();
|
||||||
|
Keyboard.Focus(TicketSelectionContainer);
|
||||||
|
}), System.Windows.Threading.DispatcherPriority.Input);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2554,6 +2562,15 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
TicketSelectionBorder_Click();
|
TicketSelectionBorder_Click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TicketSelectionContainer_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key != Key.Escape || TicketSelectionPopUp?.IsOpen != true)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TicketSelectionPopUp.IsOpen = false;
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
private void TicketSummaryTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void TicketSummaryTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -2792,10 +2809,26 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
|
|
||||||
private void Combobox_PreviewKeyDown(object sender, KeyEventArgs e)
|
private void Combobox_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Key == Key.Escape)
|
if (e.Key != Key.Escape)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (sender is ComboBoxPageable pageable && pageable.CloseDropDownIfOpen())
|
||||||
{
|
{
|
||||||
if (sender is FrameworkElement fe && IsInsidePageable(fe)) return;
|
e.Handled = true;
|
||||||
DropDownClosed(sender, e);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sender is HierarchicalSelectionControl hierarchicalSelectionControl && hierarchicalSelectionControl.CloseDropDownIfOpen())
|
||||||
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sender is ComboBox comboBox && comboBox.IsDropDownOpen)
|
||||||
|
{
|
||||||
|
comboBox.IsDropDownOpen = false;
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -816,7 +816,10 @@ namespace FasdDesktopUi.Pages.SearchPage
|
|||||||
if (cFasdCockpitCommunicationBase.Instance?.IsDemo() == true)
|
if (cFasdCockpitCommunicationBase.Instance?.IsDemo() == true)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return cFasdCockpitConfig.Instance?.Global?.TicketConfiguration?.ShowOverview == true
|
var isSearchAvailable = cConnectionStatusHelper.Instance?.ApiConnectionStatus == cConnectionStatusHelper.enumOnlineStatus.online;
|
||||||
|
|
||||||
|
return isSearchAvailable
|
||||||
|
&& cFasdCockpitConfig.Instance?.Global?.TicketConfiguration?.ShowOverview == true
|
||||||
&& IsTicketIntegrationActive()
|
&& IsTicketIntegrationActive()
|
||||||
&& cFasdCockpitConfig.Instance.HasM42Configuration();
|
&& cFasdCockpitConfig.Instance.HasM42Configuration();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
PreviewKeyDown="CustomMessageBox_PreviewKeyDown"
|
KeyDown="CustomMessageBox_KeyDown"
|
||||||
IsVisibleChanged="BlurInvoker_IsActiveChanged">
|
IsVisibleChanged="BlurInvoker_IsActiveChanged">
|
||||||
|
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
|
|||||||
@@ -280,14 +280,15 @@ namespace FasdDesktopUi.Pages.TicketCompletion
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void CustomMessageBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
private void CustomMessageBox_KeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
switch (e.Key)
|
if (e.Key != Key.Escape)
|
||||||
{
|
{
|
||||||
case Key.Escape:
|
return;
|
||||||
Close_Click();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Close_Click();
|
||||||
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DoCloseActionAsync()
|
private async Task DoCloseActionAsync()
|
||||||
|
|||||||
Reference in New Issue
Block a user