-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMainWindow.xaml
34 lines (34 loc) · 2.2 KB
/
MainWindow.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
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource Composition}"
Title="{Binding ClockViewModel.Time}"
FontFamily="Consolas"
FontWeight="Bold">
<StackPanel Name="Clock" Opacity=".4" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding ClockViewModel}">
<TextBlock Text="{Binding Date}" FontSize="64" HorizontalAlignment="Center" />
<TextBlock Text="{Binding Time}" FontSize="128" HorizontalAlignment="Center" />
<StackPanel.Effect>
<DropShadowEffect Color="Black" Direction="20" ShadowDepth="0" Opacity="0" RenderingBias="Performance" />
</StackPanel.Effect>
<StackPanel.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Clock" Storyboard.TargetProperty="Opacity" From=".4" To="1" Duration="0:0:0.3" />
<DoubleAnimation Storyboard.TargetName="Clock" Storyboard.TargetProperty="(Effect).Opacity" From="0" To=".5" Duration="0:0:0.3" />
<DoubleAnimation Storyboard.TargetName="Clock" Storyboard.TargetProperty="(Effect).ShadowDepth" From="0" To="8" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard HandoffBehavior="SnapshotAndReplace">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Clock" Storyboard.TargetProperty="Opacity" From="1" To=".4" Duration="0:0:0.3" />
<DoubleAnimation Storyboard.TargetName="Clock" Storyboard.TargetProperty="(Effect).Opacity" From=".5" To="0" Duration="0:0:0.3" />
<DoubleAnimation Storyboard.TargetName="Clock" Storyboard.TargetProperty="(Effect).ShadowDepth" From="8" To="0" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</StackPanel.Triggers>
</StackPanel>
</Window>