WindowsCommunityToolkit
WindowsCommunityToolkit copied to clipboard
StopAnimationAction ArgumentNullException
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.