aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchBusyIndicator.xaml
blob: a3f26aa6e897b4468056a1d61e0627b714fec70d (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:converters="clr-namespace:Tango.Touch.Converters"
                    xmlns:local="clr-namespace:Tango.Touch.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary>
            <converters:ArcEndPointConverter x:Key="ArcEndPointConverter" />
            <converters:ArcSizeConverter x:Key="ArcSizeConverter" />
            <converters:RotateTransformCentreConverter x:Key="RotateTransformCentreConverter" />
            <converters:NotZeroConverter x:Key="NotZeroConverter" />
            <converters:RotateTransformConverter x:Key="RotateTransformConverter" />
            <converters:StartPointConverter x:Key="StartPointConverter" />
            <converters:LargeArcConverter x:Key="LargeArcConverter" />
        </ResourceDictionary>

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


    <Style TargetType="{x:Type local:TouchBusyIndicator}">
        <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Width" Value="20" />
        <Setter Property="Height" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TouchBusyIndicator}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="IsIndeterminateStoryboard" TargetName="RotateTransform" TargetProperty="Angle" RepeatBehavior="Forever">
                            <DoubleAnimation From="0" To="359" Duration="0:0:2" />
                        </Storyboard>
                        <Storyboard x:Key="IsFullyIndeterminateScaleStoryboard">
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FullyIndeterminateGridScaleTransform"
                                                           Storyboard.TargetProperty="ScaleX"
                                                           RepeatBehavior="Forever">
                                <SplineDoubleKeyFrame KeyTime="0" Value="0.0" />
                                <SplineDoubleKeyFrame KeyTime="0:0:1" Value="1.0" />
                                <SplineDoubleKeyFrame KeyTime="0:0:4" Value="0.0" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="RotateTransform"
                                             Storyboard.TargetProperty="Angle" 
                                             RepeatBehavior="Forever"
                                             From="00" To="359" Duration="0:0:1.25" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid x:Name="TemplateRoot" ClipToBounds="False">
                        <Grid x:Name="FullyIndeterminateGrid">
                            <Grid.RenderTransform>
                                <ScaleTransform x:Name="FullyIndeterminateGridScaleTransform" ScaleX="0" />
                            </Grid.RenderTransform>
                        </Grid>
                        <Grid x:Name="PathGrid" Margin="2" />
                        <Canvas>
                            <Ellipse Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" />
                            <Path x:Name="Path" Stroke="{TemplateBinding Foreground}" StrokeThickness="{Binding RelativeSource={RelativeSource TemplatedParent},Path=StrokeThickness}" 
                                  Canvas.Top="2" Canvas.Left="2"
                                  RenderTransformOrigin="0, 0">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure StartPoint="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource StartPointConverter}, Mode=OneWay}">
                                            <ArcSegment Size="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource ArcSizeConverter}, Mode=OneWay}"
                                                        SweepDirection="Clockwise">
                                                <ArcSegment.IsLargeArc>
                                                    <MultiBinding Converter="{StaticResource LargeArcConverter}">
                                                        <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value" />
                                                        <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Minimum" />
                                                        <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Maximum" />
                                                        <Binding ElementName="FullyIndeterminateGridScaleTransform" Path="ScaleX" />
                                                    </MultiBinding>
                                                </ArcSegment.IsLargeArc>
                                                <ArcSegment.Point>
                                                    <MultiBinding Converter="{StaticResource ArcEndPointConverter}">
                                                        <Binding ElementName="PathGrid" Path="ActualWidth" />
                                                        <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value" />
                                                        <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Minimum" />
                                                        <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Maximum" />
                                                        <Binding ElementName="FullyIndeterminateGridScaleTransform" Path="ScaleX" />
                                                    </MultiBinding>
                                                </ArcSegment.Point>
                                            </ArcSegment>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <RotateTransform x:Name="RotateTransform"
                                                         CenterX="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource RotateTransformCentreConverter}, Mode=OneWay}" 
                                                         CenterY="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource RotateTransformCentreConverter}, Mode=OneWay}">
                                            <RotateTransform.Angle>
                                                <MultiBinding Converter="{StaticResource RotateTransformConverter}">
                                                    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value" />
                                                    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Minimum" />
                                                    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Maximum" />
                                                </MultiBinding>
                                            </RotateTransform.Angle>
                                        </RotateTransform>
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                        </Canvas>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsIndeterminate, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding IsVisible, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Value, RelativeSource={RelativeSource Self}, Converter={StaticResource NotZeroConverter}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.EnterActions>
                                <RemoveStoryboard BeginStoryboardName="IsFullyIndeterminateStoryboard" />
                                <BeginStoryboard Storyboard="{StaticResource IsIndeterminateStoryboard}"
                                                 Name="IsIndeterminateStoryboard"/>
                            </MultiDataTrigger.EnterActions>
                            <MultiDataTrigger.ExitActions>
                                <RemoveStoryboard BeginStoryboardName="IsIndeterminateStoryboard" />
                            </MultiDataTrigger.ExitActions>
                        </MultiDataTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsIndeterminate" Value="True" />
                                <Condition Property="Value" Value="0" />
                                <Condition Property="IsVisible" Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <RemoveStoryboard BeginStoryboardName="IsIndeterminateStoryboard" />
                                <BeginStoryboard Storyboard="{StaticResource IsFullyIndeterminateScaleStoryboard}"
                                                 Name="IsFullyIndeterminateStoryboard"/>
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <RemoveStoryboard BeginStoryboardName="IsFullyIndeterminateStoryboard" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsIndeterminate" Value="False" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <RemoveStoryboard BeginStoryboardName="IsIndeterminateStoryboard" />
                                <RemoveStoryboard BeginStoryboardName="IsFullyIndeterminateStoryboard" />
                            </MultiTrigger.EnterActions>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
mitSwitchRequest", "StubOptLimitSwitchRequest", "", sizeof(StubOptLimitSwitchRequest), 2, stub_opt_limit_switch_request__field_descriptors, stub_opt_limit_switch_request__field_indices_by_name, 1, stub_opt_limit_switch_request__number_ranges, (ProtobufCMessageInit) stub_opt_limit_switch_request__init, NULL,NULL,NULL /* reserved[123] */ };