简体   繁体   中英

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.

我想更改 Slider 的样式 C# XAML 8.1

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM