|
| 1 | +<UserControl x:Class="MaterialDesignColors.WpfExample.Sliders" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:local="clr-namespace:MaterialDesignColors.WpfExample" |
| 7 | + mc:Ignorable="d" |
| 8 | + d:DesignHeight="300" d:DesignWidth="300"> |
| 9 | + |
| 10 | + <UserControl.Resources> |
| 11 | + <ResourceDictionary> |
| 12 | + <ResourceDictionary.MergedDictionaries> |
| 13 | + <!-- note you only need bring in these extra resource dictionaries when using non-default styles, so only bring them into your controls where the default style is not what you want --> |
| 14 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Slider.xaml" /> |
| 15 | + </ResourceDictionary.MergedDictionaries> |
| 16 | + </ResourceDictionary> |
| 17 | + </UserControl.Resources> |
| 18 | + |
| 19 | + <Grid VerticalAlignment="Top"> |
| 20 | + <Grid.ColumnDefinitions> |
| 21 | + <ColumnDefinition /> |
| 22 | + <ColumnDefinition /> |
| 23 | + </Grid.ColumnDefinitions> |
| 24 | + <Grid.RowDefinitions> |
| 25 | + <RowDefinition Height="Auto" /> |
| 26 | + <RowDefinition Height="Auto" /> |
| 27 | + <RowDefinition Height="Auto" /> |
| 28 | + <RowDefinition Height="Auto" /> |
| 29 | + <RowDefinition Height="Auto" /> |
| 30 | + <RowDefinition Height="Auto" /> |
| 31 | + </Grid.RowDefinitions> |
| 32 | + <Slider Grid.Row="0" TickFrequency="5" Orientation="Horizontal" Minimum="1" Maximum="50" Value="25" /> |
| 33 | + <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" |
| 34 | + Margin="0 36 0 0"> |
| 35 | + <Slider TickFrequency="5" TickPlacement="BottomRight" Orientation="Vertical" Minimum="1" Maximum="50" /> |
| 36 | + <Slider TickFrequency="25" TickPlacement="TopLeft" Orientation="Vertical" Minimum="1" Maximum="50" IsEnabled="False" Margin="24 8 0 8" /> |
| 37 | + </StackPanel> |
| 38 | + <Slider Grid.Row="1" TickFrequency="5" Orientation="Horizontal" TickPlacement="BottomRight" Minimum="1" Maximum="50" Value="25" IsSelectionRangeEnabled="True" |
| 39 | + Margin="0 36 0 0" /> |
| 40 | + <Slider Grid.Row="2" TickFrequency="5" Orientation="Horizontal" TickPlacement="BottomRight" Minimum="1" Maximum="50" Value="25" IsEnabled="False" |
| 41 | + Margin="0 36 0 0" /> |
| 42 | + |
| 43 | + <StackPanel Orientation="Horizontal" Grid.Row="3" Margin="0 16 0 0"> |
| 44 | + <TextBlock VerticalAlignment="Bottom">Try me</TextBlock> |
| 45 | + <Slider Minimum="0" Maximum="100" Style="{StaticResource MaterialDesignDiscreteSlider}" |
| 46 | + Value="50" |
| 47 | + Width="280" |
| 48 | + Margin="8 0 0 0"/> |
| 49 | + </StackPanel> |
| 50 | + <Slider Minimum="0" Maximum="10" Margin="0 24 0 0" Style="{StaticResource MaterialDesignDiscreteSlider}" Grid.Row="4" Width="260" HorizontalAlignment="Left" /> |
| 51 | + <Slider Minimum="0" Maximum="10" Margin="0 24 0 0" Style="{StaticResource MaterialDesignDiscreteSlider}" Grid.Row="5" Width="260" HorizontalAlignment="Left" /> |
| 52 | + |
| 53 | + </Grid> |
| 54 | +</UserControl> |
0 commit comments