Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
XamNumericSlider - Gets unwanted Keyboard focus
posted

Hi, 

We are using a XamNumericSlider in a UserControl. We're trying to sort out the tabbing order - but without much luck. The XamNumericSlider keeps receiving the keyboard focus when tabbing between controls, even though we don't want it to. What is worse is that it takes about 4 clicks to tab out of it again, as both start and end arrows take focus as well as the slider item itself. 

We have the following XAML:

<ig:XamNumericSlider MinValue="1" MaxValue="5" 

Value="{Binding MinTicks, Mode=TwoWay}" ToolTip="{Binding MinTicks, Mode=OneWay}" 

EnableKeyboardNavigation="False"

IsTabStop="False" 

Focusable="False" 

KeyboardNavigation.IsTabStop="False">

So despite setting all of the above values (specifically the last four properties!), it still receives focus and paints the adorner border around the items within the Slider! I don't want to have to template the control to be able to turn this off considering the number of properties I've already set on the parent slider control.

Can you please advise?

Thanks,

Russell

  • 138253
    Offline posted

    Hello Russell,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

  • 138253
    Offline posted

    Hello Russel,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I suggest you add the following Styles for the XamSliderNumericThumb and TrackFill:

    <Style TargetType="{x:Type igPrim:TrackFill}">
        <Setter Property="IsTabStop" Value="False"/>
    </Style>            
    <Style TargetType="{x:Type ig:XamSliderNumericThumb}">
        <Setter Property="IsTabStop" Value="False"/>
    </Style>
    

     

    And handle the XamNumericSlider’s Loaded event and add the following code in its handler:

    (Utilities.GetDescendantFromName(sender as DependencyObject, "HorizontalDecrease") as RepeatButton).IsTabStop = false;
    (Utilities.GetDescendantFromName(sender as DependencyObject, "HorizontalIncrease") as RepeatButton).IsTabStop = false;
    

     

    Feel free to write me if you have further questions.