Browse Source

repro

animation-fill-modes-test
Jumar Macato 6 years ago
parent
commit
388d9d604f
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 19
      samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml
  2. 10
      src/Avalonia.Animation/AnimationInstance`1.cs

19
samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml

@ -3,26 +3,21 @@
xmlns:l="clr-namespace:ControlCatalog.Pages;assembly=ControlCatalog"
x:Class="ControlCatalog.Pages.AutoCompleteBoxPage">
<l:AutoCompleteBoxPage.Styles>
<Style Selector="l|AutoCompleteBoxPage[SideBarEnabled=False] Grid#sidebar">
<Style Selector="l|AutoCompleteBoxPage[SideBarEnabled=True] Grid#sidebar">
<Style.Animations>
<Animation Duration="0:0:0.5" FillMode="Both" Easing="QuadraticEaseIn">
<!-- <KeyFrame Cue="0%">
<Setter Property="Width" Value="250" />
</KeyFrame> -->
<Animation Duration="0:0:0.5" FillMode="Both" Easing="QuadraticEaseOut">
<KeyFrame Cue="100%">
<Setter Property="Width" Value="0" />
<Setter Property="Width" Value="250" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="l|AutoCompleteBoxPage[SideBarEnabled=True] Grid#sidebar">
<Style Selector="l|AutoCompleteBoxPage[SideBarEnabled=False] Grid#sidebar">
<Style.Animations>
<Animation Duration="0:0:0.5" FillMode="Both" Easing="QuadraticEaseOut">
<!-- <KeyFrame Cue="0%">
<Setter Property="Width" Value="0" />
</KeyFrame> -->
<Animation Duration="0:0:0.5" FillMode="Both" Easing="QuadraticEaseIn">
<KeyFrame Cue="100%">
<Setter Property="Width" Value="250" />
<Setter Property="Width" Value="0" />
</KeyFrame>
</Animation>
</Style.Animations>

10
src/Avalonia.Animation/AnimationInstance`1.cs

@ -119,9 +119,10 @@ namespace Avalonia.Animation
{
if (_fillMode == FillMode.Backward || _fillMode == FillMode.Both)
if (_currentIteration == 0)
PublishNext(_firstKFValue);
_targetControl.SetValue(_animator.Property, _firstKFValue, BindingPriority.LocalValue);
else
PublishNext(_lastInterpValue);
_targetControl.SetValue(_animator.Property, _lastInterpValue, BindingPriority.LocalValue);
}
private void DoPlayStates()
@ -151,11 +152,14 @@ namespace Avalonia.Animation
if ((_fillMode == FillMode.Backward
|| _fillMode == FillMode.Both) & indexTime == 0)
{
DoDelay();
_targetControl.SetValue(_animator.Property, _neutralValue, BindingPriority.LocalValue);
return;
}
else if (indexTime > 0 & indexTime <= initDelay)
{
DoDelay();
return;
}
else
{

Loading…
Cancel
Save