aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchLoadingPanel.xaml
blob: 9a2a51017a46857fda55cd80adda96721f5bc0bf (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
<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 TargetType="{x:Type local:TouchLoadingPanel}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TouchLoadingPanel}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <Grid>
                            <ContentPresenter Content="{TemplateBinding Content}" />
                            
                            <Grid Background="#9EFFFFFF">
                                <Grid.Style>
                                    <Style TargetType="Grid">
                                        <Setter Property="IsHitTestVisible" Value="False"></Setter>
                                        <Setter Property="Opacity" Value="0"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchLoadingPanel},Path=IsLoading}" Value="True">
                                                <Setter Property="IsHitTestVisible" Value="False"></Setter>
                                                <DataTrigger.EnterActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.EnterActions>
                                                <DataTrigger.ExitActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.1"></DoubleAnimation>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.ExitActions>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Grid.Style>

                                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                                    <local:TouchBusyIndicator Foreground="{TemplateBinding Foreground}" IsIndeterminate="{TemplateBinding IsLoading}" Width="100" Height="100" HorizontalAlignment="Center" />
                                    <TextBlock Margin="20" Text="{TemplateBinding LoadingMessage}" HorizontalAlignment="Center" />
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>