j.pn
j.pn

Reputation: 61

Slider's thumb form change. C# XAML 8.1

I'm making Windows 8.1 phone app using Visual Studio 2015 and C# XAML.

I want to change the slider's thumb to a "round" style, like below. Can is be easily changed or not?

Please help me change the slider's style.

I want to change Slider's style C# XAML 8.1

Upvotes: 1

Views: 376

Answers (1)

Chirag Shah
Chirag Shah

Reputation: 981

Try the following style for the slider thumb:

XAML:

<Style x:Key="SliderThumbStyle"
                                   TargetType="Thumb">
                                <Setter Property="BorderThickness"
                                        Value="0" />
                                <Setter Property="BorderBrush"
                                        Value="{ThemeResource SliderThumbBorderThemeBrush}" />
                                <Setter Property="Background"
                                        Value="{ThemeResource SliderThumbBackgroundThemeBrush}" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Thumb">
                                            <Border Background="{TemplateBinding Background}"
                                                    BorderBrush="{TemplateBinding BorderBrush}"
                                                    BorderThickness="{TemplateBinding BorderThickness}"
                                                    CornerRadius="4" />
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>

Upvotes: 1

Related Questions