-
Notifications
You must be signed in to change notification settings - Fork 80
/
EffectAnimationsSampleOptions.xaml.cs
81 lines (66 loc) · 3.07 KB
/
EffectAnimationsSampleOptions.xaml.cs
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.WinUI.Animations;
namespace MediaExperiment.Samples;
[ToolkitSampleOptionsPane(nameof(EffectAnimationsSample))]
[ToolkitSampleOptionsPane(nameof(ColorEffectAnimationSample))]
[ToolkitSampleOptionsPane(nameof(BlurEffectAnimationSample))]
[ToolkitSampleOptionsPane(nameof(CrossFadeEffectAnimationSample))]
[ToolkitSampleOptionsPane(nameof(ExposureEffectAnimationSample))]
[ToolkitSampleOptionsPane(nameof(HueRotationEffectAnimationSample))]
[ToolkitSampleOptionsPane(nameof(SaturationEffectAnimationSample))]
[ToolkitSampleOptionsPane(nameof(SepiaEffectAnimationSample))]
public sealed partial class EffectAnimationsSampleOptions : Page
{
private AnimationSet _animationSet;
public EffectAnimationsSampleOptions(AnimationSet animationSet)
{
_animationSet = animationSet;
this.InitializeComponent();
}
public EffectAnimationsSampleOptions(EffectAnimationsSample sampleInstance)
: this(new EffectAnimationsSample.XamlNamedPropertyRelay(sampleInstance).ClipAnimation)
{
}
public EffectAnimationsSampleOptions(ColorEffectAnimationSample sampleInstance)
: this(new ColorEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).ColorAnimation)
{
}
public EffectAnimationsSampleOptions(BlurEffectAnimationSample sampleInstance)
: this(new BlurEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).BlurAnimation)
{
}
public EffectAnimationsSampleOptions(CrossFadeEffectAnimationSample sampleInstance)
: this(new CrossFadeEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).CrossFadeAnimation)
{
}
public EffectAnimationsSampleOptions(ExposureEffectAnimationSample sampleInstance)
: this(new ExposureEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).ExposureAnimation)
{
}
public EffectAnimationsSampleOptions(HueRotationEffectAnimationSample sampleInstance)
: this(new HueRotationEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).HueRotationAnimation)
{
}
public EffectAnimationsSampleOptions(OpacityEffectAnimationSample sampleInstance)
: this(new OpacityEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).OpacityAnimation)
{
}
public EffectAnimationsSampleOptions(SaturationEffectAnimationSample sampleInstance)
: this(new SaturationEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).SaturationAnimation)
{
}
public EffectAnimationsSampleOptions(SepiaEffectAnimationSample sampleInstance)
: this(new SepiaEffectAnimationSample.XamlNamedPropertyRelay(sampleInstance).SepiaAnimation)
{
}
public void OnStartAnimationButton_Clicked(object sender, RoutedEventArgs e)
{
_animationSet.Start();
}
public void OnStopAnimationButton_Clicked(object sender, RoutedEventArgs e)
{
_animationSet.Stop();
}
}