Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Integration with UICompositionAnimations #3108

Closed
Sergio0694 opened this issue Jan 24, 2020 · 5 comments
Closed

[Feature] Integration with UICompositionAnimations #3108

Sergio0694 opened this issue Jan 24, 2020 · 5 comments
Labels
feature request 📬 A request for new changes to improve functionality
Milestone

Comments

@Sergio0694
Copy link
Member

Sergio0694 commented Jan 24, 2020

Describe the problem this feature would solve

Hi everyone, I'm opening this issue following a conversation with @michael-hawker over at the UWP Community Discord server about integrating my UICompositionAnimations library into the Windows Community Toolkit. I've proceeded to do an initial refactoring of my entirely library to split it into three different, self-contained projects (now referred to as FluentExtensions):

  • FluentExtensions.UI, which only contains some XAML attached properties, some markup extensions and some UI dispatch helpers.
  • FluentExtensions.UI.Animations, which contains all my XAML/Composition animation extensions (screen here), and additional helpers to setup things like expression animations on a ScrollViewer.
  • FluentExtensions.UI.Brushes, which contains my custom pipeline builder class to create Win2D/Composition effects, along with a set of APIs that allow devs to easily create custom effects pipelines directly from XAML (screen here), to use them as brushes.

Now, over time many of my helpers have been added in some equivalent form to the Windows Community Toolkit, in particular the animation extensions, which overlap almost entirely with equivalent APIs from the Windows Community Toolkit. On the other hand, stuff like my pipeline XAML effects are exclusive to my library and are not available in any form with the Windows Community Toolkit, and I think they'd be a great addition to it that other developers could use as well.

Considering this, my idea would be to fully integrate my library into the Windows Community Toolkit, following three main principles:

  • After the integration is complete, it should be possible for apps currently using UICompositionAnimations (eg. myTube!, Legere, OneLocker, Brainf*ck#, SoundByte, Quarrel) to ditch it entirely, and switch to the Windows Community Toolkit without loss of functionality.

  • Wherever the Windows Community Toolkit offers equivalent APIs, those APIs from the UICompositionAnimations library should be ditched.

  • If for a given set of equivalent APIs, the UICompositionAnimations library offers additional features not directly available from the toolkit, those should be ported over to enrich the API set of the Windows Community Toolkit, if possible.

This would make new useful APIs available for a larger number of developers too, and expand the feature set of the Windows Community Toolkit in the process. Also, it would allow all the apps using UICompositionAnimations to ditch it and just rely on the Windows Community Toolkit going forward.

The point of this issue is mainly to discuss specific features from UICompositionAnimations and how to properly integrate them into this repository, offer suggestions on how to achieve equivalent results only using currently existing APIs from the toolkit, if possible, and to track all the individual PRs needed to port the features from UICompositionAnimations to the Windows Community Toolkit.

Describe the solution

I've made a list of all the individual things I'd like to port to the Windows Community Toolkit, starting from the simplest things to port. For each item, there's a small description and a link to the related pull request, if existing. Also, for some items, some additional discussion will be needed. Eg. I'll create a draft PR for the brushes item, and we can see there how to better include them in the toolkit. Similarly, I will need some help from people familiar with the toolkit to see how to properly handle the animations part.

Feature Description Dependencies PR
DispatcherExtensions A class that provides helpers/extensions to run delegates on the UI thread SDK 10240 #3119
ClipHelper A XAML attached property that uses a composition InsetClip to clip the rendering coming from inside a given UIElement SDK 16299 #3111
FontIconExtension A XAML markup extension that creates a FontIcon from a string representing a Segoe MDL2 icon, resulting in much cleaner code (see here) SDK 16299 #3110
ScrollViewerExtensions A class with two extension methods for the ScrollViewer class, to easily start an expression animation binding the scrolling to offset of a target UIElement SDK 16299 #3220
Animations Extension methods to create/run/await animations that can run either on the XAML or Composition layer. Composition translation animation is available too. These adapt automatically depending on the target layer (eg. if you run a translation animation with composition, the lib will use those APIs, instead if you're targeting XAML it'll automatically create a render transform for you and animate that instead. Or, the size animation targets Visual.Size with composition, or the actual element height/width (with dependent animations) if you choose XAML) SDK 16299 #3639
Brushes The C# pipeline builder class and helper methods to load Win2D textures, and classes to create and use brushes from XAML. SDK 17134, Win2D #3112

Thanks in advance to everyone willing to help out, give feedbacks or contribute to the discussion on how to properly do this and organize work on this going forward! 😄

I'll get started on the first PRs in the meantime, looking forward to hearing from you!

@Sergio0694 Sergio0694 added the feature request 📬 A request for new changes to improve functionality label Jan 24, 2020
@ghost ghost added the needs triage 🔍 label Jan 24, 2020
@ghost
Copy link

ghost commented Jan 24, 2020

Thanks for submitting a new feature request! I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future!

@Sergio0694 Sergio0694 changed the title [Feature] Integrating UICompositionAnimations into the toolkit [Feature] Integration with UICompositionAnimations Jan 24, 2020
@michael-hawker michael-hawker added this to the 6.1 milestone Jan 27, 2020
@michael-hawker
Copy link
Member

Thanks for all the details @Sergio0694! This sounds like a great start.

I did some digging in our current Animations package and found that SurfaceLoader, the Light Extension, Saturation, and Blur effects are the ones that use the Win2D dependency. So it'd be great if for 7.0 (see #3062) we can split those out into the Microsoft.Toolkit.Uwp.UI.Media package to centralize our Win2D needs.

In the meantime for if we do a 6.1 release before then, we can just start moving things over in the right spots as appropriate as you've already started doing. 😊

@michael-hawker
Copy link
Member

I think we've got the smaller more portable items over in 6.1 already, but there's still a bulk of the 'Animation' part to coordinate for 7.0, so I'm going to move this to track that work for that release.

@michael-hawker
Copy link
Member

michael-hawker commented Dec 18, 2020

@Sergio0694 you good with closing this now that we have #3638 to track the overall animation work in more detail? (And everything else was done before in 6.1)

@Sergio0694
Copy link
Member Author

Sure thing! We can continue in the animations issue 👍

@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request 📬 A request for new changes to improve functionality
Projects
None yet
Development

No branches or pull requests

2 participants