Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/new animations #3680

Merged
merged 184 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
3362890
Creating Microsoft.Toolkit.Uwp.UI.Behaviors
michael-hawker Dec 17, 2020
68c0cbb
Merge branch 'dev/new-animations' into behaviors-package
michael-hawker Dec 17, 2020
9d874a8
Ported enum types
Sergio0694 Dec 17, 2020
1cd5802
Code refactoring, switched to previous EasingType
Sergio0694 Dec 17, 2020
9f77bb9
Removed ScrollHeader from project description
michael-hawker Dec 17, 2020
0c7085a
Reintroduced AnimationExtensions mapping
Sergio0694 Dec 17, 2020
d8efc04
Ported Compositor and CompositionObject extensions
Sergio0694 Dec 17, 2020
7c8df90
Ported DependencyObject and Storyboard extensions
Sergio0694 Dec 17, 2020
e13dcba
Ported EasingTypeExtensions type
Sergio0694 Dec 17, 2020
8c5af50
Initial porting of AnimationBuilder
Sergio0694 Dec 17, 2020
8d466db
Added more animation APIs
Sergio0694 Dec 17, 2020
ac84415
Added initial XAML mapping types
Sergio0694 Dec 18, 2020
800f5d8
Added StartAnimationAction type
Sergio0694 Dec 18, 2020
dd467d2
Minor code refactoring
Sergio0694 Dec 18, 2020
e77296f
Added Explicit class, enabled auto-binding to parent
Sergio0694 Dec 18, 2020
6afc1b0
Switched AnimationCollection2 to DependencyObject
Sergio0694 Dec 18, 2020
f8a8457
Added AnimationEndBehavior
Sergio0694 Dec 18, 2020
a2eef12
Added AnimationStartBehavior type
Sergio0694 Dec 18, 2020
26aeba7
Added extension to attach pipeline effects to elements
Sergio0694 Dec 18, 2020
3fe603c
Minor code tweaks
Sergio0694 Dec 18, 2020
f971a94
Added extensibility to attached visuals
Sergio0694 Dec 18, 2020
5ec8ab3
Enabled notification for brush in use to effects
Sergio0694 Dec 18, 2020
e88a6ac
Initial draft support for animating effects
Sergio0694 Dec 18, 2020
9c0a50a
Added missing file headers
Sergio0694 Dec 18, 2020
ddb66d2
Add new Behaviors project to Smoke Tests
michael-hawker Dec 19, 2020
d3dcc9b
Merge pull request #3634 from michael-hawker/behaviors-package
michael-hawker Dec 19, 2020
f9d1cf2
Merge branch 'dev/new-animations' into feature/animation-apis-revamp
michael-hawker Dec 19, 2020
bf81a2a
Minor code tweaks
Sergio0694 Dec 19, 2020
ce10ef3
Fixed some StyleCop warnings
Sergio0694 Dec 19, 2020
789e261
Added AnimationDictionary type, code tweaks
Sergio0694 Dec 19, 2020
65c2c58
Optimized reuse of weak parent references
Sergio0694 Dec 19, 2020
b30190e
Ported remaining animation types
Sergio0694 Dec 19, 2020
4fdcae7
Added RotateInDegrees builder API
Sergio0694 Dec 19, 2020
df597c4
Code refactoring
Sergio0694 Dec 19, 2020
0db9c13
Added AnimationBuilder.New() and XML docs
Sergio0694 Dec 19, 2020
a881c9f
Minor code tweaks
Sergio0694 Dec 19, 2020
867354b
Added AnimationScope type, inherited easing type/mode
Sergio0694 Dec 19, 2020
738f2b6
Added ScaleAnimation type
Sergio0694 Dec 19, 2020
79a2ae4
Fixed AnimationCollection2 exceptions being unobserved
Sergio0694 Dec 19, 2020
9b2d3f6
Minor code refactoring
Sergio0694 Dec 19, 2020
50b0c21
Added NormalizedKeyFrameAnimationBuilder<T> types
Sergio0694 Dec 19, 2020
87ce483
Added AnimationBuilder.NormalizedKeyFrames<T>
Sergio0694 Dec 19, 2020
80164f1
Added AnimationBuilder.TimedKeyFrames<T>
Sergio0694 Dec 20, 2020
57a8456
Suppressed XML docs warning
Sergio0694 Dec 20, 2020
9a30179
Added ITimedKeyFrameAnimationBuilderExtensions
Sergio0694 Dec 20, 2020
2c2b96a
Fixed StyleCop warnings
Sergio0694 Dec 20, 2020
916915f
Code refactoring to keyframe animation builders
Sergio0694 Dec 20, 2020
c3d139b
Uniformed type support for keyframed animations
Sergio0694 Dec 20, 2020
01e2cb3
Minor tweaks to the default animations
Sergio0694 Dec 20, 2020
e3dab22
Changed animation duration to be nullable
Sergio0694 Dec 20, 2020
ec9cae6
Minor code tweaks
Sergio0694 Dec 20, 2020
56bc3fc
Changed "from" parameters to be optional
Sergio0694 Dec 20, 2020
4458505
Added missing nullable default values
Sergio0694 Dec 20, 2020
07a8585
Added more compositor animation extensions
Sergio0694 Dec 21, 2020
406a298
Added missing XAML animation creation extensions
Sergio0694 Dec 21, 2020
a60c428
Code refactoring, improved AnimationBuilder flexibility
Sergio0694 Dec 21, 2020
9105cf0
Minor code refactoring
Sergio0694 Dec 21, 2020
1d3de3c
Improved internal AnimationBuilder architecture
Sergio0694 Dec 21, 2020
203b907
Added new Clip animation overload
Sergio0694 Dec 21, 2020
89e097a
Added missing default animation XAML nodes
Sergio0694 Dec 21, 2020
22b6051
Minor code tweaks
Sergio0694 Dec 21, 2020
a59bb79
More small code tweaks
Sergio0694 Dec 21, 2020
829f15a
Added ListBuilder<T> type
Sergio0694 Dec 22, 2020
126797d
Minor code style tweaks
Sergio0694 Dec 22, 2020
c8e0567
Added missing animation APIs
Sergio0694 Dec 22, 2020
aa79263
Added AnimationBuilder.Transform API
Sergio0694 Dec 22, 2020
2ca1542
Minor tweaks to public keyframe builder interfaces
Sergio0694 Dec 22, 2020
8385b6e
Removed unnecessary extensions
Sergio0694 Dec 22, 2020
66746f9
Added builder types for new keyframe APIs
Sergio0694 Dec 22, 2020
df043fb
Minor code tweaks and bug fixes
Sergio0694 Dec 22, 2020
6c8b949
Added strongly-typed keyframed animation APIs
Sergio0694 Dec 22, 2020
ca80384
Renamed AnimationBuilder.New() to Create()
Sergio0694 Dec 22, 2020
ef4a249
Added missing AnimationBuilder private constructor
Sergio0694 Dec 22, 2020
2790c4f
Removed unnecessary visibility modifiers
Sergio0694 Dec 22, 2020
921061c
Added APIs to insert external animations
Sergio0694 Dec 22, 2020
232ea59
Minor code refactoring
Sergio0694 Dec 22, 2020
1f4806b
Added IsSequential property to animation collections
Sergio0694 Dec 23, 2020
86dc1d3
Moved XAML keyframe types
Sergio0694 Dec 23, 2020
35b29b3
Added support for ObjectAnimationUsingKeyFrames
Sergio0694 Dec 23, 2020
8d75564
Switched XAML animation types to strongly typed
Sergio0694 Dec 23, 2020
1aa8f3a
Minor code tweaks
Sergio0694 Dec 23, 2020
d96413c
Added IKeyFrame<T> interface
Sergio0694 Dec 23, 2020
0c89f54
Added OrientationAnimation type
Sergio0694 Dec 23, 2020
d721347
Implemented support for keyframe XAML animations
Sergio0694 Dec 23, 2020
2584b8b
Removed previous XAML animation/keyframe types
Sergio0694 Dec 23, 2020
f500432
Added default values for animation extensions, minor tweaks
Sergio0694 Dec 23, 2020
2151b30
Added workaround for XAML parsing limitations
Sergio0694 Dec 24, 2020
a95d30f
Added expression support to keyframe builders
Sergio0694 Dec 25, 2020
ff288be
Added infrastructure to support implicit animations
Sergio0694 Dec 25, 2020
4c7c1af
Updated default animation XAML types
Sergio0694 Dec 25, 2020
de3b5b9
Implemented implicit animations with new backend
Sergio0694 Dec 25, 2020
0acfbad
Removed .Xaml namespace
Sergio0694 Dec 25, 2020
cc7b0a0
Removed legacy code, fully migrated to new backend
Sergio0694 Dec 25, 2020
d103248
Minor code tweaks
Sergio0694 Dec 25, 2020
b3bdfd1
Added expression support to keyframes
Sergio0694 Dec 25, 2020
060b154
Fixed an incorrect XML summary cref reference
Sergio0694 Dec 26, 2020
d963d11
Updated default easing parameters
Sergio0694 Dec 26, 2020
9b5f4d2
Updated ReorderGridAnimation type
Sergio0694 Dec 26, 2020
d05027d
Minor code tweaks
Sergio0694 Dec 26, 2020
7adb7c8
Code refactoring, simplified default XAML animations
Sergio0694 Dec 26, 2020
dae4b0a
Minor code tweaks
Sergio0694 Dec 26, 2020
2009eb6
Added custom animation types
Sergio0694 Dec 26, 2020
0ae8c4d
Fixed a build error
Sergio0694 Dec 26, 2020
7a53d9c
Suppressed an incorrect IntelliSense warning
Sergio0694 Dec 26, 2020
76fa6b2
Added stateful keyframe animation builder APIs
Sergio0694 Dec 26, 2020
e909584
Removed some closure/delegate allocations
Sergio0694 Dec 26, 2020
2f01c60
Improved dispatching for Vector2 composition animations
Sergio0694 Dec 26, 2020
38a4896
Added missing translation settings for implicit animations
Sergio0694 Dec 27, 2020
3d1b976
Fixed incorrect delay for implicit animations
Sergio0694 Dec 27, 2020
8bad140
Updated sample app to use the updated APIs 🎉
Sergio0694 Dec 27, 2020
36838de
Removed animation property string interpolation
Sergio0694 Dec 27, 2020
bbe37de
Fixed ItemsReorderGridAnimation sample page
Sergio0694 Dec 27, 2020
3568ed7
Renamed ReorderGridAnimation sample page files
Sergio0694 Dec 27, 2020
24f005b
Added base PipelineEffect class
Sergio0694 Dec 27, 2020
e12ca49
Added base EffectAnimation type
Sergio0694 Dec 27, 2020
b0272ab
Code refactoring to BlurEffect
Sergio0694 Dec 27, 2020
6900738
Added single-property effect animation types
Sergio0694 Dec 27, 2020
7c282b5
Added missing file header
Sergio0694 Dec 27, 2020
9903609
Replaced Blur behaviors with visual factory APIs
Sergio0694 Dec 27, 2020
a6f4047
Minor code refactoring
Sergio0694 Dec 27, 2020
7262c7c
Skipped easing function for default easing modes
Sergio0694 Dec 27, 2020
cedbbf7
Moved the ScrollViewer expression animation extensions
Sergio0694 Dec 27, 2020
253fd7d
Added ITrigger interface for the AnimationSet type
Sergio0694 Dec 28, 2020
1248320
Added missing default XAML animation types
Sergio0694 Dec 31, 2020
38b370a
Simplified namespace for effect animations
Sergio0694 Dec 31, 2020
54b293a
Simplified namespace for effect XAML types
Sergio0694 Dec 31, 2020
71e3eed
Fixed StartAnimationAction for external animations
Sergio0694 Dec 31, 2020
6c3ac04
Fixed composition size animation type
Sergio0694 Jan 2, 2021
b7b7fa4
Speed optimization to VisualExtensions.NormalizedCenterPoint
Sergio0694 Jan 2, 2021
0d502fe
Merge remote-tracking branch 'origin/master' into dev/new-animations
michael-hawker Jan 2, 2021
700364b
Merge branch 'dev/new-animations' into feature/animation-apis-revamp
michael-hawker Jan 2, 2021
f137278
Update Fade Behavior Example for new Animations
michael-hawker Dec 31, 2020
40f699e
Fix issues preventing Sample App to build with Namespace Changes
michael-hawker Jan 2, 2021
acd7d87
Add Activity and StartAnimationActivity
michael-hawker Jan 2, 2021
5a6dc18
Fixed StyleCop warnings, minor code style tweaks
Sergio0694 Jan 3, 2021
f4a2a4b
Added ColorKeyFrame type
Sergio0694 Jan 4, 2021
91c856b
Added cancellation support to AnimationBuilder
Sergio0694 Jan 4, 2021
b22b356
Added cancellation support to AnimationSet
Sergio0694 Jan 6, 2021
5ef29ba
Added OperationCanceledException-s handling
Sergio0694 Jan 6, 2021
b1cc8db
Added cancellation check in sequential mode
Sergio0694 Jan 8, 2021
59d1a03
Added StopAnimationActivity type
Sergio0694 Jan 8, 2021
fa67d9d
Switched animation properties to DependencyProperty
Sergio0694 Jan 8, 2021
af409df
Fixed {Binding ElementName} for effect animations
Sergio0694 Jan 8, 2021
671939c
Merge branch 'master' into dev/new-animations
michael-hawker Jan 8, 2021
b8e1eed
Merge branch 'dev/new-animations' into feature/animation-apis-revamp
michael-hawker Jan 8, 2021
04939b5
Fixed overlapping animations in AnimationSet
Sergio0694 Jan 8, 2021
9e4f4bc
Add InvokeActionsActivity to Behaviors Package and Sample
michael-hawker Jan 8, 2021
93c8244
Added direction parameter to compositor extensions
Sergio0694 Jan 8, 2021
87ff9e4
Merge remote-tracking branch 'origin/master' into dev/new-animations
michael-hawker Jan 12, 2021
b3cedab
Merge remote-tracking branch 'origin/dev/new-animations' into feature…
michael-hawker Jan 12, 2021
aaa6b0d
Added more options to XAML animation extensions
Sergio0694 Jan 12, 2021
8bac49c
Added RepeatOption type
Sergio0694 Jan 12, 2021
cf76265
Added RepeatOption support to AnimationBuilder
Sergio0694 Jan 12, 2021
587f012
Implemented RepeatOption property to XAML types
Sergio0694 Jan 12, 2021
2aed95f
Added missing file header
Sergio0694 Jan 12, 2021
8615699
Renamed RepeatOption.One to Once
Sergio0694 Jan 13, 2021
64a3ee6
Fixed case sensitivity when parsing RepeatOption
Sergio0694 Jan 13, 2021
e61db4d
Minor code tweaks
Sergio0694 Jan 13, 2021
a3e3fff
Tweaked some namespaces
Sergio0694 Jan 17, 2021
4a48c82
Added effect animations sample page (WIP)
Sergio0694 Jan 17, 2021
4fdecd7
Added sample page for VisualEffectFactory
Sergio0694 Jan 17, 2021
3ccaf64
Fixed the PipelineBrush sample page
Sergio0694 Jan 17, 2021
86bd2d1
Merge remote-tracking branch 'origin/master' into dev/new-animations
michael-hawker Jan 19, 2021
ffc309a
Merge branch 'dev/new-animations' into feature/animation-apis-revamp
Sergio0694 Jan 19, 2021
14d5464
Fixed {Binding} for effect animations from AnimationScope
Sergio0694 Jan 20, 2021
4a7436a
Fixed sample page for effect animations
Sergio0694 Jan 20, 2021
10a02d7
Fixed an error in the Effects/Fade sample page
Sergio0694 Jan 20, 2021
e5ee018
Updated Blur sample page
Sergio0694 Jan 20, 2021
b4db2f0
Fixed some C# sample pages
Sergio0694 Jan 20, 2021
cd67f1d
Removed leftover files
Sergio0694 Jan 20, 2021
e6b1c5f
Removed Light sample (for now)
Sergio0694 Jan 20, 2021
9c5fd3e
Updated Offset sample page
Sergio0694 Jan 20, 2021
faaf5ed
Removed leftover files
Sergio0694 Jan 20, 2021
9ee094d
Updated Saturation sample page
Sergio0694 Jan 20, 2021
f4c3579
Updated Scale sample page
Sergio0694 Jan 20, 2021
5606483
Updated Rotate sample page
Sergio0694 Jan 20, 2021
563eb21
Update Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Animations/Effects…
michael-hawker Jan 21, 2021
6196cdf
Reverted accidental edit in Fade sample page
Sergio0694 Jan 21, 2021
608b308
Fixed Offset sample page
Sergio0694 Jan 21, 2021
4f35471
Added StopAnimationAction
Sergio0694 Jan 21, 2021
f362ebf
Improved exception messages with effect animations
Sergio0694 Jan 21, 2021
86843c2
Simplified namespace organization
Sergio0694 Jan 21, 2021
6a080a6
Merge pull request #3639 from Sergio0694/feature/animation-apis-revamp
Rosuavio Jan 21, 2021
8a47256
Merge branch 'master' into dev/new-animations
michael-hawker Jan 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,7 @@ dotnet_diagnostic.SA1652.severity = none

dotnet_diagnostic.SA1629.severity = none # DocumentationTextMustEndWithAPeriod: Let's enable this rule back when we shift to WinUI3 (v8.x). If we do it now, it would mean more than 400 file changes.
dotnet_diagnostic.SA1413.severity = none # UseTrailingCommasInMultiLineInitializers: This would also mean a lot of changes at the end of all multiline initializers. It's also debatable if we want this or not.
dotnet_diagnostic.SA1314.severity = none # TypeParameterNamesMustBeginWithT: We do have a few templates that don't start with T. We need to double check that changing this is not a breaking change. If not, we can re-enable this.
dotnet_diagnostic.SA1314.severity = none # TypeParameterNamesMustBeginWithT: We do have a few templates that don't start with T. We need to double check that changing this is not a breaking change. If not, we can re-enable this.
dotnet_diagnostic.SA1000.severity = none # Hide warnings when using the new() expression from C# 9.
dotnet_diagnostic.SA1313.severity = none # Hide warnings for record parameters.
dotnet_diagnostic.SA1101.severity = none # Hide warnings when accessing properties without "this".
Binary file added Microsoft.Toolkit.Uwp.SampleApp/Assets/Llama.mp3
Binary file not shown.
110 changes: 32 additions & 78 deletions Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Toolkit.Graph.Converters;
using Microsoft.Toolkit.Graph.Providers;
using Microsoft.Toolkit.Uwp.Helpers;
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
using Microsoft.Toolkit.Uwp.SampleApp.Models;
Expand Down Expand Up @@ -660,16 +658,16 @@ private static Type LookForTypeByName(string typeName)
}

// Search in Microsoft.Toolkit.Graph.Controls
var graphControlsProxyType = typeof(UserToPersonConverter);
assembly = graphControlsProxyType.GetTypeInfo().Assembly;

foreach (var typeInfo in assembly.ExportedTypes)
{
if (typeInfo.Name == typeName)
{
return typeInfo;
}
}
//var graphControlsProxyType = typeof(UserToPersonConverter);
//assembly = graphControlsProxyType.GetTypeInfo().Assembly;

//foreach (var typeInfo in assembly.ExportedTypes)
//{
// if (typeInfo.Name == typeName)
// {
// return typeInfo;
// }
//}

// Search in Microsoft.Toolkit.Uwp.UI.Animations
var animationsProxyType = EasingType.Default;
Expand Down
272 changes: 159 additions & 113 deletions Microsoft.Toolkit.Uwp.SampleApp/Pages/About.xaml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Microsoft.Toolkit.Uwp.SampleApp/Pages/About.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ private async Task Init()
From = 0,
To = 1,
Duration = TimeSpan.FromMilliseconds(300),
Delay = TimeSpan.FromMilliseconds(counter++ * delay),
SetInitialValueBeforeDelay = true
Delay = TimeSpan.FromMilliseconds(counter++ * delay)
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Page
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"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:mediaactions="using:Microsoft.Xaml.Interactions.Media"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d">

<Button Background="Gray" Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center">
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="MoveAnimation" IsSequential="True">
<ani:StartAnimationActivity Animation="{Binding ElementName=FadeOutAnimation}"/>
<ani:InvokeActionsActivity>
<interactions:ChangePropertyAction TargetObject="{Binding ElementName=MyText}" PropertyName="Foreground" Value="Purple"/>
<mediaactions:PlaySoundAction Source="Assets/Llama.mp3"/>
</ani:InvokeActionsActivity>
<ani:StartAnimationActivity Delay="0:0:2" Animation="{Binding ElementName=FadeInAnimation}"/>
</ani:AnimationSet>
</ani:Explicit.Animations>

<TextBlock x:Name="MyText" Text="🦙 Text">
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="FadeOutAnimation">
<ani:OpacityAnimation From="1"
To="0"
Duration="0:0:1"
Delay="0"
EasingType="Linear"
EasingMode="EaseOut"/>
</ani:AnimationSet>
<ani:AnimationSet x:Name="FadeInAnimation">
<ani:OpacityAnimation From="0"
To="1"
Duration="0:0:1"
Delay="0"
EasingType="Linear"
EasingMode="EaseOut"/>
</ani:AnimationSet>
</ani:Explicit.Animations>
</TextBlock>

<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="Click">
<interactions:ChangePropertyAction TargetObject="{Binding ElementName=MyText}" PropertyName="Foreground" Value="White"/>
<behaviors:StartAnimationAction Animation="{Binding ElementName=MoveAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Page
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"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d">

<Button Background="Gray" Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center">
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="MoveAnimation" IsSequential="True">
<ani:TranslationAnimation Duration="0:0:3" To="0,32,0" From="0,0,0" />
<ani:StartAnimationActivity Delay="0:0:3" Animation="{Binding ElementName=FadeOutAnimation}"/>
<ani:StartAnimationActivity Delay="0:0:3" Animation="{Binding ElementName=FadeInAnimation}"/>
<ani:TranslationAnimation Duration="0:0:1" To="0,0,0" From="0,32,0" />
</ani:AnimationSet>
</ani:Explicit.Animations>

<Image Source="ms-appx:///Assets/ToolkitLogo.png" Height="100" Width="100">
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="FadeOutAnimation">
<ani:OpacityAnimation From="1"
To="0"
Duration="0:0:1"
Delay="0"
EasingType="Linear"
EasingMode="EaseOut"/>
</ani:AnimationSet>
<ani:AnimationSet x:Name="FadeInAnimation">
<ani:OpacityAnimation From="0"
To="1"
Duration="0:0:1"
Delay="0"
EasingType="Linear"
EasingMode="EaseOut"/>
</ani:AnimationSet>
</ani:Explicit.Animations>
</Image>

<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="Click">
<behaviors:StartAnimationAction Animation="{Binding ElementName=MoveAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// XAML UIElement
<Image x:Name="ToolkitLogo" Source="ms-appx:///Assets/Square150x150Logo.png" Height="100" Width="100" >

// C# - Blur can be applied to any UIElement. In this case it is an image called ToolkitLogo.
using Microsoft.Toolkit.Uwp.UI.Animations;

// Create and attacha a sprite visual with an animatable blur effect
var sprite = await PipelineBuilder
.FromBackdrop()
.Blur(0, out EffectAnimation<float> blurAnimation)
.AttachAsync(ToolkitLogo, ToolkitLogo);

// Start the animation on the applied brush
blurAnimation(sprite.Brush, 32, TimeSpan.FromSeconds(3));
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Page
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"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d">

<Button Background="Gray" Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center">
<media:UIElementExtensions.VisualFactory>
<media:PipelineVisualFactory>
<media:BlurEffect x:Name="ImageBlurEffect" IsAnimatable="True"/>
</media:PipelineVisualFactory>
</media:UIElementExtensions.VisualFactory>
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="BlurAnimation">
<ani:BlurEffectAnimation From="0"
To="32"
Duration="0:0:3"
EasingType="Linear"
EasingMode="EaseOut"
Target="{Binding ElementName=ImageBlurEffect}"/>
</ani:AnimationSet>
</ani:Explicit.Animations>

<Image Source="ms-appx:///Assets/ToolkitLogo.png" Height="100" Width="100"/>

<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="Loaded">
<behaviors:StartAnimationAction Animation="{Binding ElementName=BlurAnimation}"/>
</interactions:EventTriggerBehavior>
<interactions:EventTriggerBehavior EventName="Click">
<behaviors:StartAnimationAction Animation="{Binding ElementName=BlurAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// XAML UIElement
<Image x:Name="ToolkitLogo" Source="ms-appx:///Assets/Square150x150Logo.png" Height="100" Width="100" >

// C# - Offset can be applied to any UIElement. In this case it is an image called ToolkitLogo.
using Microsoft.Toolkit.Uwp.UI.Animations;

// Create and start the animation. Note that animating the offset will
// change how the item is also positioned within its parent item. If you
// want to animate the position of an element with respect to its original
// relative position to its parent, use a translation animation instead.
await AnimationBuilder.Create().Offset(to: new Vector2(20, 30), duration: TimeSpan.FromSeconds(3)).StartAsync(ToolkitLogo);

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Page
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"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d">

<Button Background="Gray" Width="200" Height="200" VerticalAlignment="Top">
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="OffsetAnimation">
<ani:OffsetAnimation From="0"
To="100,100,0"
Duration="0:0:3"
EasingType="Linear"
EasingMode="EaseOut"/>
</ani:AnimationSet>
</ani:Explicit.Animations>

<Image Source="ms-appx:///Assets/ToolkitLogo.png" Height="100" Width="100"/>

<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="Loaded">
<behaviors:StartAnimationAction Animation="{Binding ElementName=OffsetAnimation}"/>
</interactions:EventTriggerBehavior>
<interactions:EventTriggerBehavior EventName="Click">
<behaviors:StartAnimationAction Animation="{Binding ElementName=OffsetAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
// C# - Rotate can be applied to any UIElement. In this case it is an image called ToolkitLogo.
using Microsoft.Toolkit.Uwp.UI.Animations;

await ToolkitLogo.Rotate(value: 90.0f,
centerX: 0.5f,
centerY: 0.0f,
duration: 10, delay: 0).StartAsync();
await AnimationBuilder.Create().RotationInDegrees(to: 90, duration: TimeSpan.FromSeconds(3)).StartAsync(ToolkitLogo);
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Page
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"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
xmlns:ex="using:Microsoft.Toolkit.Uwp.UI.Extensions"
mc:Ignorable="d">

<Button Background="Gray"
Width="200"
Height="200"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ex:VisualExtensions.NormalizedCenterPoint="0.5">
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="RotateAnimation">
<ani:RotationInDegreesAnimation From="0"
To="360"
Duration="0:0:3"
EasingType="Linear"
EasingMode="EaseOut"/>
</ani:AnimationSet>
</ani:Explicit.Animations>

<Image Source="ms-appx:///Assets/ToolkitLogo.png" Height="100" Width="100"/>

<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="Loaded">
<behaviors:StartAnimationAction Animation="{Binding ElementName=RotateAnimation}"/>
</interactions:EventTriggerBehavior>
<interactions:EventTriggerBehavior EventName="Click">
<behaviors:StartAnimationAction Animation="{Binding ElementName=RotateAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// XAML UIElement
<Image x:Name="ToolkitLogo" Source="ms-appx:///Assets/Square150x150Logo.png" Height="100" Width="100" >

// C# - Saturation can be applied to any UIElement. In this case it is an image called ToolkitLogo.
using Microsoft.Toolkit.Uwp.UI.Animations;

// Create and attacha a sprite visual with an animatable blur effect
var sprite = await PipelineBuilder
.FromBackdrop()
.Saturation(0, out EffectAnimation<float> saturationAnimation)
.AttachAsync(ToolkitLogo, ToolkitLogo);

// Start the animation on the applied brush
saturationAnimation(sprite.Brush, 1, TimeSpan.FromSeconds(3));
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Page
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"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d">

<Button Padding="0" Background="Gray" Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center">
<media:UIElementExtensions.VisualFactory>
<media:PipelineVisualFactory>
<media:SaturationEffect x:Name="ImageSaturationEffect" Value="1" IsAnimatable="True"/>
</media:PipelineVisualFactory>
</media:UIElementExtensions.VisualFactory>
<ani:Explicit.Animations>
<ani:AnimationSet x:Name="SaturationAnimation">
<ani:SaturationEffectAnimation From="0"
To="1"
Duration="0:0:3"
EasingType="Linear"
EasingMode="EaseOut"
Target="{Binding ElementName=ImageSaturationEffect}"/>
</ani:AnimationSet>
</ani:Explicit.Animations>

<Image Source="ms-appx:///Assets/Photos/BigFourSummerHeat.jpg" />

<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="Loaded">
<behaviors:StartAnimationAction Animation="{Binding ElementName=SaturationAnimation}"/>
</interactions:EventTriggerBehavior>
<interactions:EventTriggerBehavior EventName="Click">
<behaviors:StartAnimationAction Animation="{Binding ElementName=SaturationAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@
// C# - Scale can be applied to any UIElement. In this case it is an image called ToolkitLogo.
using Microsoft.Toolkit.Uwp.UI.Animations;

await ToolkitLogo.Scale(centerX: 0.5f,
centerY: 0.0f,
scaleX: 2.0f,
scaleY: 0.1f,
duration: 10, delay: 0).StartAsync();
await AnimationBuilder.Create().Scale(to: new Vector2(1.4f), duration: TimeSpan.FromSeconds(3)).StartAsync(ToolkitLogo);
Loading