aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/SliderContentControl.xaml
blob: 9e2b85c60c7971f4b13e87a68600119fc783ff09 (plain)
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
88
89
90
91
92
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Tango.Touch.Controls"
                   >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Resources/Colors.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="RepeatButtonTransparent" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ThumbSlider" Style.TargetType="{x:Type Thumb}" >
        <Setter Setter.Property="SnapsToDevicePixels" Setter.Value="True" />
        <Setter Setter.Property="OverridesDefaultStyle" Setter.Value="True" />
        <Setter Setter.Property="Template">
            <Setter.Value>
                <ControlTemplate  TargetType="{x:Type Thumb}">
                    <Grid x:Name="grip" HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
                        <Ellipse HorizontalAlignment="Center" VerticalAlignment="Center"
                                 Height="{Binding ActualWidth, RelativeSource={RelativeSource Self}}" 
                                 Width="{Binding ThumbHeight, RelativeSource={RelativeSource AncestorType=local:SliderContentControl}}"  >
                            <Ellipse.Fill>
                                <SolidColorBrush Color="{Binding ThumbColor, RelativeSource={RelativeSource AncestorType=local:SliderContentControl}}"/>
                            </Ellipse.Fill>
                        </Ellipse>

                        <!--<Ellipse x:Name="knob" Grid.Column="0" Grid.Row="1" Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="0" Fill="{StaticResource TangoPrimaryAccentBrush}" Opacity="0.5"></Ellipse>-->
                        <Grid.Effect>
                            <DropShadowEffect BlurRadius="10" RenderingBias="Quality" ShadowDepth="1" Color="{StaticResource TangoDropShadowColor}"/>
                        </Grid.Effect>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:SliderContentControl}">
        <Setter Property="Background" Value="{StaticResource TangoNotificationBarMaskBrush}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:SliderContentControl}">
                    <Border  BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True" CornerRadius="6">
                        <Grid>
                            <!--<ContentPresenter Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" />-->
                            <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="1*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="1*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                                <Border x:Name="PART_ColorPickerDisplay" Grid.Row="1" Background="Transparent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0"  
                                        MinHeight="14" Margin="5 0 0 0"  VerticalAlignment="center" CornerRadius="6" >
                                    <ContentPresenter Panel.ZIndex="1"  Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" />
                            </Border>

                            <Track Track.Name="PART_Track" Grid.Row="0"  Margin="0 -2 0 0" VerticalAlignment="Center" Grid.RowSpan="3">
                                <!--<Track.DecreaseRepeatButton>
                                    <RepeatButton  Style="{StaticResource RepeatButtonTransparent}" />
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Style="{StaticResource RepeatButtonTransparent}" />
                                </Track.IncreaseRepeatButton>-->
                                <Track.Thumb>
                                    <Thumb Thumb.Name="PART_Thumb" UIElement.Focusable="False" Height="Auto" Style="{StaticResource ThumbSlider}" VerticalAlignment="Top" Width="Auto" VerticalContentAlignment="Top"/>
                                </Track.Thumb>
                            </Track>
                        </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>