Pre loader

FocusVisualStyle/Focus for Scichart elements

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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

  • _ _
    • _ _
    • 7 years ago
    • 1
    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 Burnett-Thompson
    Ah great, thanks for sharing!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies