Live Chat Icon For mobile
Live Chat Icon

WPF FAQ - Slider

Find answers for the most frequently asked questions
Expand All Collapse All

You can bind two sliders, one on each of two windows and both of them linked to the same data. But they both have to be bound to the same instance of your data.


yourDataType yourDataInstance = new YourDataType();
yourWindow1Instance.DataContext = yourDataInstance;
yourWindow2Instance.DataContext= yourDataInstance;


           <Slider Value='{Binding ValueProperty}' />
            <Slider Value='{Binding ValueProperty}' />


The ticks on the slider can be customized using the code given below.


<Slider Width='100' Value='50' Orientation='Horizontal' HorizontalAlignment='Left' 
IsSnapToTickEnabled='True' Maximum='3' TickPlacement='BottomRight' 
AutoToolTipPlacement='BottomRight' AutoToolTipPrecision='2' 
Ticks='0, 1.1, 2.5, 3'/>


Share with

Couldn't find the FAQs you're looking for?

Please submit your question and answer.