-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewsLoaderControl.xaml
More file actions
131 lines (122 loc) · 9.21 KB
/
Copy pathNewsLoaderControl.xaml
File metadata and controls
131 lines (122 loc) · 9.21 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<UserControl x:Class="Launcher.NewsLoaderControl"
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"
x:Name="NewsControl"
d:DesignWidth="840" d:DesignHeight="480" MouseLeftButtonDown="NewsControl_MouseLeftButtonDown">
<UserControl.Resources>
<Storyboard x:Key="HoverEffectEnter">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonArrowLeft">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonArrowRight">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BodyBg">
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="HoverEffectLeave">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.9"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonArrowLeft">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonArrowRight">
<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BodyBg">
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="ChangeItemsBegin">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="ChangeItemsEnd">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Style x:Key="PlayButton" TargetType="{x:Type Button}" BasedOn="{x:Null}">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<ControlTemplate.Resources>
<Storyboard x:Key="MouseHover">
<ColorAnimation Storyboard.TargetProperty="Background.Color" Storyboard.TargetName="Border" Duration="0:0:0.3" To="#AA36bffe"/>
</Storyboard>
<Storyboard x:Key="MouseLeave">
<ColorAnimation Storyboard.TargetProperty="Background.Color" Storyboard.TargetName="Border" Duration="0:0:0.3" To="#66000000"/>
</Storyboard>
</ControlTemplate.Resources>
<Grid x:Name="Grid" Opacity="1">
<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" HorizontalAlignment="Stretch" Width="Auto" CornerRadius="3" Background="#66000000"/>
<!--<TextBlock x:Name="ContentText" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="Auto"/>-->
<ContentPresenter x:Name="ContentText" Margin="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
RecognizesAccessKey="True"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<!--<Setter Property="Background" Value="#AA36bffe" TargetName="Border"/>-->
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource MouseHover}"/>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource MouseLeave}"/>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Value="#7f000000" Property="Background" TargetName="Border"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="0.20" TargetName="Grid"/>
</Trigger>
<Trigger Property="IsEnabled" Value="true"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="UIElement.MouseEnter">
<BeginStoryboard Storyboard="{StaticResource HoverEffectEnter}"/>
</EventTrigger>
<EventTrigger RoutedEvent="UIElement.MouseLeave">
<BeginStoryboard Storyboard="{StaticResource HoverEffectLeave}"/>
</EventTrigger>
</UserControl.Triggers>
<Grid x:Name="LayoutRoot" Opacity="0.9">
<Image Source="img/news_bg.jpg" Stretch="UniformToFill"/>
<Label x:Name="NewsIndacatorLabel" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="{Binding Foreground, ElementName=NewsControl}" FontFamily="Verdana" FontSize="18">
<TextBlock x:Name="NewsIndicatorText" Text="Загрузка новостей..." TextWrapping="Wrap"/>
</Label>
<Grid x:Name="MainGrid" Background="#E5000000" Visibility="Hidden">
<Image x:Name="NewsImageControl" />
<Rectangle x:Name="BodyBg" Fill="#99000000" Height="{Binding ActualHeight, ElementName=StackPanel}" VerticalAlignment="Bottom" Opacity="0"/>
<StackPanel x:Name="StackPanel" VerticalAlignment="Bottom">
<TextBlock x:Name="NewsHeadControl" FontFamily="Vendara" FontSize="30" Foreground="{Binding Foreground, ElementName=NewsControl}" TextWrapping="Wrap" Padding="20,0" />
<TextBlock x:Name="NewsBodyControl" FontFamily="Vendara" FontSize="14" Foreground="{Binding Foreground, ElementName=NewsControl}" TextWrapping="Wrap" Padding="10,0"/>
</StackPanel>
</Grid>
<Button x:Name="ButtonArrowLeft" ClipToBounds="True" HorizontalAlignment="Left" Height="140" Width="40" VerticalAlignment="Center" FontSize="34.667" FontFamily="Californian FB" Background="#02000000" Foreground="White" BorderThickness="0" IsTabStop="False" IsHitTestVisible="True" Focusable="False" Style="{DynamicResource PlayButton}" Margin="-5" Click="BtnLeft_Click">
<Path Width="20" Height="25" Canvas.Left="22.1667" Canvas.Top="22.1667" Stretch="Fill" Fill="{Binding Foreground, ElementName=ButtonArrowLeft}" Data="F1 M 33.6458,38L 49.4792,53.8333L 38.7917,53.8333L 22.1667,38L 38.7917,22.1667L 49.4792,22.1667L 33.6458,38 Z "/>
</Button>
<Button x:Name="ButtonArrowRight" ClipToBounds="True" HorizontalAlignment="Right" Height="140" Width="40" VerticalAlignment="Center" FontSize="25" FontFamily="SimHei" Background="#02000000" Foreground="White" BorderThickness="0" IsTabStop="False" IsHitTestVisible="True" Focusable="False" Style="{DynamicResource PlayButton}" Margin="-5" Click="BtnRight_Click">
<Path Width="20" Height="25" Canvas.Left="26.5208" Canvas.Top="22.1667" Stretch="Fill" Fill="{Binding Foreground, ElementName=ButtonArrowRight}" Data="F1 M 42.3542,38L 26.5208,53.8333L 37.2083,53.8333L 53.8333,38L 37.2083,22.1667L 26.5208,22.1667L 42.3542,38 Z "/>
</Button>
</Grid>
</UserControl>