WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

StopAnimationAction ArgumentNullException

Open LeonSpors opened this issue 3 years ago • 2 comments

Describe the bug

StopAnimationAction gets executed before the property Animation got populated. The result of that is that Execute() throws an ArgumentNullException. Weirdly the same behavior doesnt effect on StartAnimationAction.

Message = "Value cannot be null. (Parameter 'Animation')"

Regression

No response

Reproducible in sample app?

  • [X] This bug can be reproduced in the sample app.

Steps to reproduce

Set the value of IsSynchronizing to false.

<local:FontAwesomeIcon x:Name="Spinner" FontAwesomeType="Duotone" Glyph="spinner-third" VerticalAlignment="Center">
    <interactivity:Interaction.Behaviors>
        <core:DataTriggerBehavior Binding="{x:Bind ViewModel.IsSynchronizing, Mode=OneWay}" Value="true">
            <behaviors:StartAnimationAction Animation="{x:Bind RotateAnimation}"/>
        </core:DataTriggerBehavior>

        <core:DataTriggerBehavior Binding="{x:Bind ViewModel.IsSynchronizing, Mode=OneWay}" Value="false">
            <behaviors:StopAnimationAction Animation="{x:Bind RotateAnimation}"/>
        </core:DataTriggerBehavior>
    </interactivity:Interaction.Behaviors>
</local:FontAwesomeIcon>

Expected behavior

StopAnimationAction should not throw an Exception if the Animation is missing or at least the property should be populated before the actual execution.

Screenshots

No response

Windows Build Number

  • [X] Windows 10 1809 (Build 17763)
  • [ ] Windows 10 1903 (Build 18362)
  • [ ] Windows 10 1909 (Build 18363)
  • [ ] Windows 10 2004 (Build 19041)
  • [ ] Windows 10 20H2 (Build 19042)
  • [ ] Windows 10 21H1 (Build 19043)
  • [ ] Windows 11 21H2 (Build 22000)
  • [ ] Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • [X] Windows 10, version 1809 (Build 17763)
  • [ ] Windows 10, version 1903 (Build 18362)
  • [ ] Windows 10, version 1909 (Build 18363)
  • [ ] Windows 10, version 2004 (Build 19041)
  • [ ] Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

17.4.1

Device form factor

Desktop

Nuget packages

CommunityToolkit.WinUI.UI.Animations (7.1.2)

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

LeonSpors avatar Nov 23 '22 09:11 LeonSpors

Hello LeonSpors, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

ghost avatar Nov 23 '22 09:11 ghost

Thanks for the report @LeonSpors, saw you mentioned version 7.1.2? Have you tried the latest 7.1.3? I feel like we changed some small things here.

In your scenario above, is the IsSynchronizing value in the VM true by default on initialization.

michael-hawker avatar Nov 29 '22 18:11 michael-hawker