SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

Hello,

Currently I have some issues with the FocusVisualStyle/focus for SciChart elements. Actually, I don’t want the SciChart elements to be focusable (with tab and/or cursor keys) at all. I can disable the tab etc. for the control I placed, but the inner controls of the Chart still seem to be focusable. This especially gets visible when I add a chart modifier to use the cursor keys to move around in theChart. The RenderSurface gets focused and the border of the surface gets changed to a dotted line. A similar behaviour can be seen in the SciChart 4 example 2D Charts > Legends > Chart Legends API. When the tab or cursor keys are used, some element of the Chart gets the focus and gets some dotted border. In this example some inner component, it seems to be part of the legend, gets a border which overlays the entire render surface.

Is there any easy way within SciChart to disable this behaviour or to control the FocusVisualStyle of the inner controls/elements?

Not sure if it’s relevant, but this is on Windows 10.

Version
4.1
  • You must to post comments
0
0

You can use an Expicit style to remove FocusVisualStyle or set Focusable on SciChart controls.

Try adding this code (Taken from Stackoverflow, here) to the SciChartSurface.Resources

<s:SciChartSurface>
    <s:SciChartSurface.Resources>
        <Style TargetType="{x:Type FrameworkElement}">
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
            <Setter Property="s:CompatibleFocus.IsFocusable" Value="False"/>
        </Style>
    </s:SciChartSurface.Resources>
</s:SciChartSurface>

Best regards,
Andrew

  • Steffan Woltjer
    Thanks. I found something similar, but I couldn’t make it work. It turns out that I had to apply this style to s:MainGrid.
  • Andrew
    Ah great, thanks for sharing!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.