aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchStepProgressBar.xaml
blob: 99953afe20d88e23a58b54f58744484a690f5d7f (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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
                    xmlns:local="clr-namespace:Tango.Touch.Controls">

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

    <converters:DisplayMemberPathConverter x:Key="DisplayMemberPathConverter" />

    <Style TargetType="{x:Type local:TouchStepProgressBar}">
        <Setter Property="CornerRadius" Value="20"></Setter>
        <Setter Property="Height" Value="40"></Setter>
        <Setter Property="SelectionMode" Value="Multiple"></Setter>
        <Setter Property="IsHitTestVisible" Value="False"></Setter>
        <Setter Property="Focusable" Value="False"></Setter>
        <Setter Property="Background" Value="{StaticResource TangoPrimaryBackgroundBrush}"></Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <UniformGrid Rows="1" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="ListBoxItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
                    <Setter Property="Background" Value="Transparent"></Setter>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListBoxItem">
                                <DockPanel Margin="1 0" x:Name="dock">
                                    <TextBlock DockPanel.Dock="Top">
                                        <TextBlock.Text>
                                            <MultiBinding Converter="{StaticResource DisplayMemberPathConverter}">
                                                <Binding/>
                                                <Binding RelativeSource="{RelativeSource AncestorType=local:TouchStepProgressBar}" Path="DisplayMemberPath" />
                                            </MultiBinding>
                                        </TextBlock.Text>
                                    </TextBlock>
                                    <Rectangle Margin="0 10 0 0" Fill="{StaticResource TangoPrimaryAccentBrush}" />
                                </DockPanel>

                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsSelected" Value="False">
                                        <Setter TargetName="dock" Property="Opacity" Value="0.5"></Setter>
                                    </Trigger>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter TargetName="dock" Property="Opacity" Value="1"></Setter>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TouchStepProgressBar}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}">

                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>