-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
52 lines (52 loc) · 2.86 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="450" Width="800" Background="#FF191919">
<Window.Resources>
<Storyboard x:Key="RotationStoryboard" RepeatBehavior="Forever">
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).(LinearGradientBrush.StartPoint)">
<LinearPointKeyFrame KeyTime="0:0:0" Value="0,0"/>
<LinearPointKeyFrame KeyTime="0:0:2" Value="0,1"/>
<LinearPointKeyFrame KeyTime="0:0:4" Value="1,1"/>
<LinearPointKeyFrame KeyTime="0:0:6" Value="1,0"/>
<LinearPointKeyFrame KeyTime="0:0:8" Value="0,0"/>
</PointAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).(LinearGradientBrush.EndPoint)">
<LinearPointKeyFrame KeyTime="0:0:0" Value="1,1"/>
<LinearPointKeyFrame KeyTime="0:0:2" Value="1,0"/>
<LinearPointKeyFrame KeyTime="0:0:4" Value="0,0"/>
<LinearPointKeyFrame KeyTime="0:0:6" Value="0,1"/>
<LinearPointKeyFrame KeyTime="0:0:8" Value="1,1"/>
</PointAnimationUsingKeyFrames>
</Storyboard>
<!-- Define the gradient brush -->
<LinearGradientBrush x:Key="GradientBrush" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Gray" Offset="0"/>
<GradientStop Color="SlateGray" Offset="0.25"/>
<GradientStop Color="DarkCyan" Offset="0.5"/>
<GradientStop Color="Cyan" Offset="0.75"/>
<GradientStop Color="DeepSkyBlue" Offset="1"/>
</LinearGradientBrush>
</Window.Resources>
<Grid>
<Border x:Name="AnimatedBorder" Width="200" Height="200" BorderThickness="5">
<Border.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Gray" Offset="0"/>
<GradientStop Color="SlateGray" Offset="0.25"/>
<GradientStop Color="DarkCyan" Offset="0.5"/>
<GradientStop Color="Cyan" Offset="0.75"/>
<GradientStop Color="DeepSkyBlue" Offset="1"/>
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Triggers>
<EventTrigger RoutedEvent="Border.Loaded">
<BeginStoryboard Storyboard="{StaticResource RotationStoryboard}"/>
</EventTrigger>
</Border.Triggers>
</Border>
</Grid>
</Window>