XAML Slider Code Sample

The XAML <Slider> element represents a slider control for WPF apps.
 
Slider element syntax: <Slider></Slider>
 
Similar to any other XAML element, Slider has common control properties. The Minimum and Maximum properties of Slider represent the minimum and maximum values of the slider range.
 
The following code snippet creates a Slider and sets its properties in XAML.
 
  1. <Slider x:Name="mcSlider" Width="300" Height="20"  
  2.         Background="Gray" Maximum="100" Minimum="0">              
  3. </Slider>  
The IsFocused property indicates whether the slider control has the focus and the IsDirectionReversed property represents the direction of the increasing value. By default, the slider control sits on the UI in a horizontal direction. Using the Orientation property, a slider control can be placed vertically.
  1. <Slider x:Name="mcSlider" Width="30" Height="300"  
  2. Background="Gray" Maximum="100" Minimum="0" Orientation="Vertical" >  
  3. </Slider>  
To avoid duplicate content, this article has move here : WPF Slider Control Tutorial


Recommended Free Ebook
Similar Articles
Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.