Updated sample app to use the updated APIs π
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
3d1b976524
ΠΠΎΠΌΠΌΠΈΡ
8bad1409ce
|
@ -13,9 +13,9 @@
|
|||
|
||||
<Page.Resources>
|
||||
|
||||
<animations:AnimationCollection x:Key="ImplicitOffset">
|
||||
<animations:OffsetAnimation Duration="0:0:0.3"></animations:OffsetAnimation>
|
||||
</animations:AnimationCollection>
|
||||
<animations:ImplicitAnimationSet x:Key="ImplicitOffset">
|
||||
<animations:OffsetAnimation Duration="0:0:0.3"/>
|
||||
</animations:ImplicitAnimationSet>
|
||||
|
||||
<Style TargetType="ContentPresenter" x:Key="ItemsContainerStyle">
|
||||
<Setter Property="animations:Implicit.Animations" Value="{StaticResource ImplicitOffset}"></Setter>
|
||||
|
@ -85,10 +85,10 @@
|
|||
Background="{ThemeResource Background-AboutPage-SidePane}"
|
||||
extensions:VisualExtensions.NormalizedCenterPoint="0, 0.5, 0">
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:ScaleAnimation From="0, 1, 0" To="1" Duration="0:0:0.3"></animations:ScaleAnimation>
|
||||
<animations:ScaleAnimation From="0, 1, 0" To="1" Duration="0:0:0.3"/>
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:ScaleAnimation From="1" To="0, 1, 0" Duration="0:0:0.3"></animations:ScaleAnimation>
|
||||
<animations:ScaleAnimation From="1" To="0, 1, 0" Duration="0:0:0.3"/>
|
||||
</animations:Implicit.HideAnimations>
|
||||
</Border>
|
||||
|
||||
|
@ -224,12 +224,12 @@
|
|||
</controls:DropShadowPanel>
|
||||
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.5"></animations:OpacityAnimation>
|
||||
<animations:ScaleAnimation From="0.9" To="1" Duration="0:0:0.5"></animations:ScaleAnimation>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.5"/>
|
||||
<animations:ScaleAnimation From="0.9" To="1" Duration="0:0:0.5"/>
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation From="1" To="0" Duration="0:0:0.2"></animations:OpacityAnimation>
|
||||
<animations:ScaleAnimation To="0.9" From="1" Duration="0:0:0.2"></animations:ScaleAnimation>
|
||||
<animations:OpacityAnimation From="1" To="0" Duration="0:0:0.2"/>
|
||||
<animations:ScaleAnimation To="0.9" From="1" Duration="0:0:0.2"/>
|
||||
</animations:Implicit.HideAnimations>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
|
|
|
@ -151,8 +151,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Pages
|
|||
From = 0,
|
||||
To = 1,
|
||||
Duration = TimeSpan.FromMilliseconds(300),
|
||||
Delay = TimeSpan.FromMilliseconds(counter++ * delay),
|
||||
SetInitialValueBeforeDelay = true
|
||||
Delay = TimeSpan.FromMilliseconds(counter++ * delay)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</animations:Implicit.ShowAnimations>
|
||||
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:ScalarAnimation Target="Opacity" Duration="0:0:1" To="0.0"/>
|
||||
<animations:OpacityAnimation Duration="0:0:1" To="0.0"/>
|
||||
<animations:ScalarAnimation Target="Translation.Y" Duration="0:0:1" To="-200">
|
||||
<animations:ScalarKeyFrame Key="0.1" Value="30"/>
|
||||
<animations:ScalarKeyFrame Key="0.5" Value="0.0"/>
|
||||
|
@ -32,11 +32,11 @@
|
|||
</animations:Implicit.HideAnimations>
|
||||
|
||||
<animations:Implicit.Animations>
|
||||
<animations:Vector3Animation Target="Offset" Duration="0:0:1"/>
|
||||
<animations:ScalarAnimation Target="RotationAngleInDegrees" ImplicitTarget="Offset" Duration="0:0:1.2" From="0" To="0">
|
||||
<animations:OffsetAnimation Duration="0:0:1"/>
|
||||
<animations:RotationInDegreesAnimation ImplicitTarget="Offset" Duration="0:0:1.2" From="0" To="0">
|
||||
<animations:ScalarKeyFrame Key="0.9" Value="80"/>
|
||||
</animations:ScalarAnimation>
|
||||
<animations:Vector3Animation Target="Scale" Duration="0:0:1"/>
|
||||
</animations:RotationInDegreesAnimation>
|
||||
<animations:ScaleAnimation Duration="0:0:1"/>
|
||||
</animations:Implicit.Animations>
|
||||
|
||||
</Border>
|
||||
|
|
|
@ -7,29 +7,36 @@
|
|||
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
|
||||
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<animations:ImplicitAnimationSet x:Name="TestAnimations">
|
||||
<animations:OpacityAnimation/>
|
||||
<animations:RotationAnimation/>
|
||||
<animations:RotationInDegreesAnimation/>
|
||||
<animations:OffsetAnimation/>
|
||||
<animations:ScaleAnimation/>
|
||||
<animations:ScalarAnimation>
|
||||
<animations:ScalarKeyFrame/>
|
||||
</animations:ScalarAnimation>
|
||||
<animations:Vector2Animation>
|
||||
<animations:Vector2KeyFrame/>
|
||||
</animations:Vector2Animation>
|
||||
<animations:Vector3Animation>
|
||||
<animations:Vector3KeyFrame/>
|
||||
</animations:Vector3Animation>
|
||||
<animations:Vector4Animation>
|
||||
<animations:Vector4KeyFrame/>
|
||||
</animations:Vector4Animation>
|
||||
<animations:QuaternionAnimation>
|
||||
<animations:QuaternionKeyFrame/>
|
||||
</animations:QuaternionAnimation>
|
||||
</animations:ImplicitAnimationSet>
|
||||
</Page.Resources>
|
||||
|
||||
|
||||
<!-- Need to have an placeholder of each element so they can be used in the XAML editor -->
|
||||
<Grid extensions:VisualExtensions.CenterPoint="50,50,0">
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:TranslationAnimation></animations:TranslationAnimation>
|
||||
<animations:OpacityAnimation></animations:OpacityAnimation>
|
||||
<animations:RotationAnimation></animations:RotationAnimation>
|
||||
<animations:RotationInDegreesAnimation></animations:RotationInDegreesAnimation>
|
||||
<animations:OffsetAnimation></animations:OffsetAnimation>
|
||||
<animations:ScalarAnimation></animations:ScalarAnimation>
|
||||
<animations:ScaleAnimation></animations:ScaleAnimation>
|
||||
<animations:Vector2Animation>
|
||||
<animations:KeyFrameCollection>
|
||||
<animations:Vector2KeyFrame></animations:Vector2KeyFrame>
|
||||
<animations:Vector3KeyFrame></animations:Vector3KeyFrame>
|
||||
<animations:Vector4KeyFrame></animations:Vector4KeyFrame>
|
||||
<animations:ExpressionKeyFrame></animations:ExpressionKeyFrame>
|
||||
<animations:ScalarKeyFrame></animations:ScalarKeyFrame>
|
||||
</animations:KeyFrameCollection>
|
||||
</animations:Vector2Animation>
|
||||
<animations:Vector3Animation></animations:Vector3Animation>
|
||||
<animations:Vector4Animation></animations:Vector4Animation>
|
||||
<animations:OpacityAnimation From="0" To="1"/>
|
||||
</animations:Implicit.ShowAnimations>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<!-- Shallow Copy -->
|
||||
<Grid>
|
||||
<GridView animations:ReorderGridAnimation.Duration="{Binding Duration.Value}">
|
||||
<GridView animations:ItemsReorderAnimation.Duration="{Binding Duration.Value}">
|
||||
</GridView>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
|
@ -221,15 +221,12 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
{
|
||||
var staggerDelay = TimeSpan.FromMilliseconds(relativeIndex * 30);
|
||||
|
||||
var animationCollection = new AnimationCollection()
|
||||
{
|
||||
new OpacityAnimation() { From = 0, To = 1, Duration = TimeSpan.FromMilliseconds(400), Delay = staggerDelay, SetInitialValueBeforeDelay = true },
|
||||
new ScaleAnimation() { From = "0.9", To = "1", Duration = TimeSpan.FromMilliseconds(400), Delay = staggerDelay }
|
||||
};
|
||||
|
||||
VisualExtensions.SetNormalizedCenterPoint(itemContainer, "0.5");
|
||||
|
||||
animationCollection.StartAnimation(itemContainer);
|
||||
AnimationBuilder.Create()
|
||||
.Opacity(from: 0, to: 1, delay: staggerDelay)
|
||||
.Scale(from: 0.9, to: 1, delay: staggerDelay)
|
||||
.Start(itemContainer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,11 +235,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
var panel = (sender as FrameworkElement).FindDescendant<DropShadowPanel>();
|
||||
if (panel != null)
|
||||
{
|
||||
var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(1200) };
|
||||
animation.StartAnimation(panel);
|
||||
|
||||
var parentAnimation = new ScaleAnimation() { To = "1", Duration = TimeSpan.FromMilliseconds(1200) };
|
||||
parentAnimation.StartAnimation(panel.Parent as UIElement);
|
||||
AnimationBuilder.Create().Opacity(0, duration: TimeSpan.FromMilliseconds(1200)).Start(panel);
|
||||
AnimationBuilder.Create().Scale(1, duration: TimeSpan.FromMilliseconds(1200)).Start((UIElement)panel.Parent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,11 +248,9 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
if (panel != null)
|
||||
{
|
||||
panel.Visibility = Visibility.Visible;
|
||||
var animation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(600) };
|
||||
animation.StartAnimation(panel);
|
||||
|
||||
var parentAnimation = new ScaleAnimation() { To = "1.1", Duration = TimeSpan.FromMilliseconds(600) };
|
||||
parentAnimation.StartAnimation(panel.Parent as UIElement);
|
||||
AnimationBuilder.Create().Opacity(1, duration: TimeSpan.FromMilliseconds(600)).Start(panel);
|
||||
AnimationBuilder.Create().Scale(1.1, duration: TimeSpan.FromMilliseconds(600)).Start((UIElement)panel.Parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
|
||||
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
|
||||
|
@ -64,14 +63,10 @@
|
|||
Duration="0" />-->
|
||||
</interactivity:Interaction.Behaviors>
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation From="1"
|
||||
To="0"
|
||||
Duration="0:0:0.2" />
|
||||
<animations:OpacityAnimation From="1" To="0" Duration="0:0:0.2" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
</Border>
|
||||
|
||||
|
@ -92,7 +87,7 @@
|
|||
<Border Background="{ThemeResource Menu-DropDown-Background}" />
|
||||
|
||||
<GridView x:Name="SamplePickerGridView"
|
||||
animations:ReorderGridAnimation.Duration="200"
|
||||
animations:ItemsReorderAnimation.Duration="0:0:0.200"
|
||||
ChoosingItemContainer="SamplePickerGridView_ChoosingItemContainer"
|
||||
IsItemClickEnabled="True"
|
||||
ItemClick="SamplePickerGridView_ItemClick"
|
||||
|
@ -111,29 +106,16 @@
|
|||
</GroupStyle>
|
||||
</GridView.GroupStyle>
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation Delay="0:0:0.2"
|
||||
SetInitialValueBeforeDelay="True"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:OpacityAnimation From="0" To="1" Delay="0:0:0.2" Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
</GridView>
|
||||
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:TranslationAnimation From="0, -1000, 0"
|
||||
To="0"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.3" />
|
||||
<animations:TranslationAnimation From="0, -1000, 0" To="0" Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation From="1"
|
||||
To="0"
|
||||
Duration="0:0:0.5" />
|
||||
<animations:TranslationAnimation From="0"
|
||||
To="0, -1000, 0"
|
||||
Duration="0:0:0.5" />
|
||||
<animations:OpacityAnimation From="1" To="0" Duration="0:0:0.5" />
|
||||
<animations:TranslationAnimation From="0" To="0, -1000, 0" Duration="0:0:0.5" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
</Grid>
|
||||
|
||||
|
@ -205,52 +187,29 @@
|
|||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="{Binding BadgeUpdateVersionRequired}" />
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation To="0"
|
||||
Duration="0:0:0.01" />
|
||||
<animations:OpacityAnimation To="0" Duration="0:0:0.01" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation Delay="0:0:0.2"
|
||||
SetInitialValueBeforeDelay="True"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.4" />
|
||||
<animations:TranslationAnimation Delay="0:0:0.2"
|
||||
From="0, 20, 0"
|
||||
To="0"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:OpacityAnimation Delay="0:0:0.2" From="0" To="1" Duration="0:0:0.4" />
|
||||
<animations:TranslationAnimation Delay="0:0:0.2" From="0, 20, 0" To="0" Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
</Border>
|
||||
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation Delay="0:0:0.2"
|
||||
SetInitialValueBeforeDelay="True"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.4" />
|
||||
<animations:TranslationAnimation Delay="0:0:0.2"
|
||||
From="0, 20, 0"
|
||||
To="0"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:OpacityAnimation Delay="0:0:0.2" From="0" To="1" Duration="0:0:0.4" />
|
||||
<animations:TranslationAnimation Delay="0:0:0.2" From="0, 20, 0" To="0" Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:ScaleAnimation From="0.5"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.3" />
|
||||
<animations:ScaleAnimation From="0.5" To="1" Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation From="1"
|
||||
To="0"
|
||||
Duration="0:0:0.2" />
|
||||
<animations:ScaleAnimation From="1"
|
||||
To="0.5"
|
||||
Duration="0:0:0.2" />
|
||||
<animations:OpacityAnimation From="1" To="0" Duration="0:0:0.2" />
|
||||
<animations:ScaleAnimation From="1" To="0.5" Duration="0:0:0.2" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
</Grid>
|
||||
</Canvas>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
ο»Ώ<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.SampleApp.Controls"
|
||||
xmlns:toolkitControls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
|
||||
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
|
||||
|
@ -135,13 +134,9 @@
|
|||
<Setter Property="Transitions" Value="{x:Null}"></Setter>
|
||||
<Setter Property="animations:Implicit.ShowAnimations">
|
||||
<Setter.Value>
|
||||
<animations:AnimationCollection>
|
||||
<animations:OpacityAnimation Duration="0:0:0.2"
|
||||
Delay="0:0:0.2"
|
||||
SetInitialValueBeforeDelay="True"
|
||||
From="0"
|
||||
To="1"></animations:OpacityAnimation>
|
||||
</animations:AnimationCollection>
|
||||
<animations:ImplicitAnimationSet>
|
||||
<animations:OpacityAnimation Duration="0:0:0.2" Delay="0:0:0.2" From="0" To="1"/>
|
||||
</animations:ImplicitAnimationSet>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅