You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AnimationDemoPage throws an exception when clicking on the button during animation:
System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
I found how to inactivate the button during the animation:
But I did not find how to cancel the animation by clicking on the "Stop animation" button.
Here what I tried out:
Above code for stopAnimationButton plus:
Hello David,
The AnimationDemoPage throws an exception when clicking on the button during animation:
System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
I found how to inactivate the button during the animation:
<Button.Behaviors>
<behaviors:EventHandlerBehavior EventName="Clicked">
<behaviors:SetPropertyAction TargetObject="{x:Reference runAnimationButton}" PropertyName="IsEnabled" Value="false" />
<behaviors:SetPropertyAction TargetObject="{x:Reference stopAnimationButton}" PropertyName="IsEnabled" Value="true" />
<behaviors:SetPropertyAction TargetObject="{x:Reference stopAnimationButton}" PropertyName="IsVisible" Value="true" />
...
<behaviors:SetPropertyAction TargetObject="{x:Reference runAnimationButton}" PropertyName="IsEnabled" Value="true" />
<behaviors:SetPropertyAction TargetObject="{x:Reference stopAnimationButton}" PropertyName="IsEnabled" Value="false" />
But I did not find how to cancel the animation by clicking on the "Stop animation" button.
Here what I tried out:
Above code for stopAnimationButton plus:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:behaviors="clr-namespace:Behaviors;assembly=Behaviors"
x:Class="Behaviors.Sample.AnimationDemoPage"
x:Name="animationPage"
Title="Animation Demo"
Icon="xaml.png">
Any idea?
Thanks.
Best regards,
Nikolas
The text was updated successfully, but these errors were encountered: