-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathThermometerExample.xaml
More file actions
58 lines (57 loc) · 2.76 KB
/
ThermometerExample.xaml
File metadata and controls
58 lines (57 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<UserControl
x:Class="WPFDevelopers.Samples.ExampleViews.ThermometerExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<controls:CodeViewer Header="{Binding NavigateMenuItem.Name}">
<Border
Width="400"
Height="400"
Background="{DynamicResource WD.BackgroundBrush}"
CornerRadius="12"
Effect="{StaticResource WD.PrimaryShadowDepth}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Slider
x:Name="PART_Slider"
Height="300"
IsSnapToTickEnabled="True"
Maximum="40"
Minimum="-10"
Orientation="Vertical"
Value="10" />
<Grid Margin="160,0,0,0" VerticalAlignment="Center">
<Path
Data="{Binding ElementName=PART_Thermometer, Path=Geometry, Mode=TwoWay}"
Fill="{DynamicResource WD.PrimaryMouseOverBrush}"
Opacity=".6"
Stroke="{DynamicResource WD.PrimaryMouseOverBrush}"
StrokeThickness="1" />
<wd:Thermometer x:Name="PART_Thermometer" Value="{Binding ElementName=PART_Slider, Path=Value, Mode=TwoWay}" />
</Grid>
<TextBlock
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Bahnschrift"
FontSize="24"
Foreground="{DynamicResource WD.PrimaryBrush}"
Text="{Binding ElementName=PART_Thermometer, Path=Value, StringFormat={}{0}℃}" />
</Grid>
</Border>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/ThermometerExample.xaml" CodeType="Xaml" />
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/ThermometerExample.xaml.cs" CodeType="CSharp" />
</controls:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>