microsoft / microsoft-ui-xaml

WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.
MIT License
6.38k stars 683 forks source link

Enable support for ElementAnimator on other Panels to help synchronize animations across the tree and avoid clips #166

Open bschoepke opened 5 years ago

bschoepke commented 5 years ago

Proposal: Enable support for ElementAnimator on other Panels to help synchronize animations across the tree and avoid clips

Summary

The ElementAnimator class makes it easy to implement coordinated add/remove animations for ItemsRepeater-based list UI. However, ElementAnimator does not work with existing Panels like StackPanel that may be parents of ItemsRepeater, so common animation scenarios are difficult to coordinate.

Rationale

Adding ElementAnimator support to Panels like StackPanel, Grid, RelativePanel, and custom Panels would make it easier to coordinate animations in scenarios where one or more ItemsRepeaters are children of the same Panel as other controls.

For example,

<StackPanel>
    <ItemsRepeater>
        <ItemsRepeater.Animator>
           <local:MyCustomElementAnimator/>
        </ItemsRepeater.Animator>
    </ItemsRepeater>

    <Button/>
</StackPanel>

When an element is removed from the ItemsRepeater above, it should be possible to apply the reposition animation defined by MyCustomElementAnimator to the Button after the hide animation completes.

micahl commented 5 years ago

This would be gated on WinUI 3.0.