Hello,
In resolving an issue I found that it is in fact due to handler for PreviewLostKeyboardFocus in LightningChart.WPF.cs, where e.Handled is true if the last key pressed was anything but Tab or a system key. As a result, an instance of LCU in a tab with which a user is interacting via the keyboard will prevent the next click on another tab from actually changing tabs. This may affect other interactions like buttons as well, but tabs I know for sure. Commenting out the line where e.Handled is set in that method in the LCU source resolves the issue, but we don't want to introduce other issues. I thought it best to take it directly to you so you can resolve it. I find it likely that other people are having this issue as well.
To reproduce the issue, here is some source.
While running, click on the chart in the first tab, hit any key other than tab or an F key, then click the second tab header. The click on the second tab header is lost.
<CODE - MainWindow.xaml>
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lcu="http://www.arction.com/schemas/"
Title="MainWindow">
<TabControl>
<TabItem Header="Tab1" x:Name="tab1" />
<TabItem Header="Tab2" x:Name="tab2" />
</TabControl>
</Window>
</CODE>
<CODE - MainWindow.xaml.cs>
using Arction.WPF.LightningChartUltimate;
using System.Windows;
namespace WpfApplication1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
tab1.Content = new LightningChartUltimate();
tab2.Content = new LightningChartUltimate();
}
}
}
</CODE>
PreviewLostKeyboardFocus interrupts tab interaction
Moderator: Queue Moderators
Re: PreviewLostKeyboardFocus interrupts tab interaction
Confirmed that buttons are not affected, but TabGroup still definitely is.
Re: PreviewLostKeyboardFocus interrupts tab interaction
The PreviewKeyDown related code was added to prevent chart's scroll bar to lose focus when e.g. right arrow key was held down. I'll look into this and try to make it better. I'll keep you posted.
Re: PreviewLostKeyboardFocus interrupts tab interaction
If you can build the source code then, as a workaround, subscribe to PreviewKeyUp event and set m_bPreviewKey to false. Works fine in my tests. If this works in every situation I think I'll leave it there permanently.
Re: PreviewLostKeyboardFocus interrupts tab interaction
We would prefer to just have this resolved in a future release, hopefully in the near future.
Re: PreviewLostKeyboardFocus interrupts tab interaction
We are planning to release a new version next week. This fix will be included in that version.
Re: PreviewLostKeyboardFocus interrupts tab interaction
Epic, thanks much Jari!