-
Notifications
You must be signed in to change notification settings - Fork 0
/
LogoTrack.xaml
78 lines (78 loc) · 3.96 KB
/
LogoTrack.xaml
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
<P1:Component
x:Class="P1.Components.LogoTrack"
xmlns:P1="clr-namespace:P1.Primitives"
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"
xmlns:local="clr-namespace:P1.Components"
mc:Ignorable="d"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
d:DesignHeight="450" d:DesignWidth="800"
x:Name="this"
>
<Canvas HorizontalAlignment="Left">
<Canvas.RenderTransform>
<TranslateTransform/>
</Canvas.RenderTransform>
<Canvas.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<!-- - actual width of tape / 2 + starting offset = -4888 / 2 - 200 = -2644 -->
<DoubleAnimation
Storyboard.TargetProperty="RenderTransform.X"
From="{Binding StartingOffset, ElementName=this}"
To="{Binding FinishingOffset, ElementName=this}"
Duration="{Binding Duration, ElementName=this}"
RepeatBehavior="Forever"
/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Canvas.Triggers>
<ItemsControl ItemsSource="{Binding Logos, ElementName=this}" Name="Track">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style>
<Setter Property="FrameworkElement.Margin" Value="36 0"/>
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<svgc:SvgViewbox Height="36" Source="{Binding Path=.}">
<svgc:SvgViewbox.Style>
<Style TargetType="svgc:SvgViewbox">
<Setter Property="Opacity" Value="0.3"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.1"
Storyboard.TargetProperty="Opacity" To="0.95" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard FillBehavior="Stop">
<DoubleAnimation Duration="0:0:0.15"
Storyboard.TargetProperty="Opacity" To="0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</Style.Triggers>
</Style>
</svgc:SvgViewbox.Style>
</svgc:SvgViewbox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Canvas>
</P1:Component>