Skip to content

Commit a832de2

Browse files
committed
discrete slider style #129
1 parent 15bd00f commit a832de2

File tree

3 files changed

+339
-123
lines changed

3 files changed

+339
-123
lines changed

MainDemo.Wpf/MainDemo.Wpf.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
<Compile Include="ProvingGround.xaml.cs">
120120
<DependentUpon>ProvingGround.xaml</DependentUpon>
121121
</Compile>
122+
<Compile Include="ProvingGroundTemp.xaml.cs">
123+
<DependentUpon>ProvingGroundTemp.xaml</DependentUpon>
124+
</Compile>
122125
<Compile Include="Shadows.xaml.cs">
123126
<DependentUpon>Shadows.xaml</DependentUpon>
124127
</Compile>
@@ -200,6 +203,10 @@
200203
<SubType>Designer</SubType>
201204
<Generator>MSBuild:Compile</Generator>
202205
</Page>
206+
<Page Include="ProvingGroundTemp.xaml">
207+
<SubType>Designer</SubType>
208+
<Generator>MSBuild:Compile</Generator>
209+
</Page>
203210
<Page Include="Shadows.xaml">
204211
<SubType>Designer</SubType>
205212
<Generator>MSBuild:Compile</Generator>
@@ -274,6 +281,9 @@
274281
<ItemGroup>
275282
<Folder Include="ProvingGroundStuff\" />
276283
</ItemGroup>
284+
<ItemGroup>
285+
<Resource Include="DetministicSliders.jpg" />
286+
</ItemGroup>
277287
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
278288
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
279289
Other similar extension points exist, see Microsoft.Common.targets.

MainDemo.Wpf/ProvingGround.xaml

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,62 +9,29 @@
99
Background="{DynamicResource MaterialDesignPaper}"
1010
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
1111
mc:Ignorable="d"
12-
d:DesignWidth="200" d:DesignHeight="120">
12+
d:DesignWidth="477" d:DesignHeight="272">
1313
<UserControl.Resources>
1414
<ResourceDictionary>
1515
<ResourceDictionary.MergedDictionaries>
16-
17-
<!-- light or dark theme -->
1816
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
19-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
20-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
21-
22-
<!-- primary color -->
23-
<ResourceDictionary>
24-
<!-- include your primary palette -->
25-
<ResourceDictionary.MergedDictionaries>
26-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Indigo.xaml" />
27-
</ResourceDictionary.MergedDictionaries>
28-
<!--
29-
include three hues from the primary palette (and the associated forecolours).
30-
Do not rename, keep in sequence; light to dark.
31-
-->
32-
<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="{StaticResource Primary100}"/>
33-
<SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="{StaticResource Primary100Foreground}"/>
34-
<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="{StaticResource Primary500}"/>
35-
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="{StaticResource Primary500Foreground}"/>
36-
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="{StaticResource Primary700}"/>
37-
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="{StaticResource Primary700Foreground}"/>
38-
</ResourceDictionary>
39-
40-
<!-- secondary colour -->
41-
<ResourceDictionary>
42-
<!-- include your secondary pallette -->
43-
<ResourceDictionary.MergedDictionaries>
44-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Yellow.xaml" />
45-
</ResourceDictionary.MergedDictionaries>
46-
47-
<!-- include a single secondary accent color (and the associated forecolour) -->
48-
<SolidColorBrush x:Key="SecondaryAccentBrush" Color="{StaticResource Accent700}"/>
49-
<SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="{StaticResource Accent700Foreground}"/>
50-
</ResourceDictionary>
17+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Slider.xaml" />
18+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
19+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
5120
</ResourceDictionary.MergedDictionaries>
52-
53-
54-
5521
</ResourceDictionary>
56-
57-
58-
5922
</UserControl.Resources>
6023

61-
62-
<Grid>
63-
<wpf:Clock DisplayAutomation="None" Is24Hours="False" VerticalAlignment="Center" HorizontalAlignment="Center">
64-
</wpf:Clock>
65-
66-
</Grid>
67-
6824

25+
<StackPanel Margin="24 0 0 0" HorizontalAlignment="Stretch">
26+
<StackPanel Orientation="Horizontal">
27+
<TextBlock VerticalAlignment="Bottom">Try me</TextBlock>
28+
<Slider Minimum="0" Maximum="100" Style="{StaticResource MaterialDesignDiscreteSlider}"
29+
Value="50"
30+
Width="280"
31+
Margin="8 0 0 0"/>
32+
</StackPanel>
33+
<Slider Minimum="0" Maximum="10" Margin="0 24 0 0" Style="{StaticResource MaterialDesignDiscreteSlider}" />
34+
<Slider Minimum="0" Maximum="10" Margin="0 24 0 0" Style="{StaticResource MaterialDesignDiscreteSlider}" />
35+
</StackPanel>
6936

7037
</UserControl>

0 commit comments

Comments
 (0)