-
Notifications
You must be signed in to change notification settings - Fork 0
/
Slider.xaml
87 lines (79 loc) · 4.96 KB
/
Slider.xaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<UserControl x:Class="Polymetal.Pdms.Design.DrawListManager.Slider"
x:Name="Root"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" Width="500">
<UserControl.Resources>
<ControlTemplate x:Key="simpleSlider" TargetType="{x:Type Slider}">
<Border SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle x:Name="PART_SelectionRange"/>
<Track x:Name="PART_Track" Grid.Row="1">
<Track.Thumb>
<Thumb x:Name="Thumb">
<Thumb.Template>
<ControlTemplate TargetType="Thumb">
<Rectangle
Stroke="Black"
StrokeThickness="1"
Width="10"
Height="18"
SnapsToDevicePixels="True"
RadiusY="2"
RadiusX ="5">
<Rectangle.Fill>
<LinearGradientBrush>
<GradientStop Color ="Silver" Offset ="0"/>
<GradientStop Color ="White" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Track.Thumb>
</Track>
</Grid>
</Border>
</ControlTemplate>
</UserControl.Resources>
<Grid VerticalAlignment="Top" Height="25">
<Border BorderThickness="0,1,0,0" BorderBrush="Black" VerticalAlignment="Center" Height="2.5"
Margin="5.333,60.05,4.667,-37.55" RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Border.RenderTransform>
</Border>
<Slider x:Name="LowerSlider"
Minimum="{Binding ElementName=Root, Path=Minimum}"
Maximum="{Binding ElementName=Root, Path=Maximum}"
Value="{Binding ElementName=Root, Path=LowerValue, Mode=TwoWay}"
Margin="0.333,54.55,9.667,-54.55"
Template="{StaticResource simpleSlider}"
/>
<Slider x:Name="UpperSlider"
Minimum="{Binding ElementName=Root, Path=Minimum}"
Maximum="{Binding ElementName=Root, Path=Maximum}"
Value="{Binding ElementName=Root, Path=UpperValue, Mode=TwoWay}"
Margin="10.333,54.55,-0.333,-54.55"
Template="{StaticResource simpleSlider}"
/>
<TextBox Name ="LowerSliderValue" Margin="0,25,0,-24.4" TextWrapping="Wrap" Text="TextBox" TextChanged="TextChangedev" FontFamily ="Times" FontSize="14" KeyUp ="LowerSliderValue_OnKeyUp" MouseEnter="LowerSliderValue_OnMouseEnter" Width="130" HorizontalAlignment="Left" />
<TextBox Name ="UpperSliderValue" Margin="141.333,25,0,-24.4" TextWrapping="Wrap" Text="TextBox" TextChanged="TextChangedev" FontFamily ="Times" FontSize="14" KeyUp="UpperSliderValue_OnKeyUp" MouseEnter="UpperSliderValue_OnMouseEnter" Width="130" HorizontalAlignment="Left" />
<Label Content="Нижняя граница" Margin="0.333,0.75,0,0" FontFamily="Times" FontSize="14" FontWeight="Bold" FontStyle="Italic" HorizontalAlignment="Left" Width="130"/>
<Label Content="Верхняя граница" Margin="141.333,0,0,0" FontFamily="Times" FontSize="14" FontWeight="Bold" FontStyle="Italic" HorizontalAlignment="Left" Width="130"/>
</Grid>
</UserControl>