Windowscommunitytoolkit: Remove Animations Package reference from Controls package

Created on 24 Nov 2020  路  4Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

Describe the bug

The Animations package is currently being pulled in as a dependency for the Controls package. However, there's only two small uses of it in the package: RangeSelector for implicit animations, and ScrollHeader for the QuickReturnHeaderBehavior.

Expected behavior

I think removing the animation for the Tooltip in RangeSelector should be simple enough. I'm not as sure what we do with ScrollHeader as a component.

But migrating these off of the animation package or moving the ScrollHeader to a different package would be a big win for our dependency graph.

This may be dependent on work we do to clean-up the Behaviors/Animations package in general with its reliance on Win2D as well.

Tied to #3062 and #3145

animations controls help wanted improvements in progress

All 4 comments

I think using the composition api directly would be better than bringing in the animation package

I did some investigation on some of the interesting dependencies from the controls.

ScrollHeader

Microsoft.Xaml.Behaviors.Uwp.Managed

Microsoft.Xaml.Interactivity;Microsoft.Xaml.Interactivity.Interaction.GetBehaviors(DependencyObject obj)

Microsoft.Toolkit.Uwp.UI

Microsoft.Toolkit.Uwp.UI.Extensions.VisualTree.FindAscendant<T>(this DependencyObject element)

Microsoft.Toolkit.Uwp.UI.Animations

Microsoft.Toolkit.Uwp.UI.Animations.Behaviors.FadeHeaderBehavior
Microsoft.Toolkit.Uwp.UI.Animations.Behaviors.QuickReturnHeaderBehavior
Microsoft.Toolkit.Uwp.UI.Animations.Behaviors.StickyHeaderBehavior

TileControl

Microsoft.Toolkit.Uwp.UI

Microsoft.Toolkit.Uwp.UI.Extensions.VisualTree.FindDescendant<T>(this DependencyObject element)

Microsoft.Toolkit.Uwp.UI.Animations

Microsoft.Toolkit.Uwp.UI.Animations.Expressions.ExpressionNode
Microsoft.Toolkit.Uwp.UI.Animations.Expressions.CompositionExtensions.GetReference(this Visual compObj)
Microsoft.Toolkit.Uwp.UI.Animations.Expressions.CompositionExtensions.GetSpecializedReference<T>(this CompositionPropertySet ps)
Microsoft.Toolkit.Uwp.UI.Animations.Expressions.ExpressionFunctions.Ceil(ScalarNode val)
Microsoft.Toolkit.Uwp.UI.Animations.Expressions.ExpressionFunctions.Conditional(BooleanNode condition, ScalarNode trueCase, ScalarNode falseCase)
Microsoft.Toolkit.Uwp.UI.Animations.Expressions.ExpressionFunctions.Abs(ScalarNode val)
Microsoft.Toolkit.Uwp.UI.Animations.Expressions.ManipulationPropertySetReferenceNode

Other

ImageCropper, Eyedropper, InfiniteCanvas all use a bunch of win2d.

3611 should take care of RangeSelector

3615 Might be hamfisted but its something to remove TileControl's and OrbitViews dep on animation.

Was this page helpful?
0 / 5 - 0 ratings