-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PipelineBrush and effects refactoring #3298
PipelineBrush and effects refactoring #3298
Conversation
Changes from official master
Changes from master
Changes from master
Thanks Sergio0694 for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely like how this improves the usability of the system with the input/effects and the stacking made clearer. And the fact that then it's more easily extensible for others to add in their own. Had a few quick initial thoughts from my initial glance.
Microsoft.Toolkit.Uwp.UI.Media/Effects/Interfaces/IPipelineNode.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/PipelineBrush/PipelineBrushPage.xaml
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI.Media/Effects/Extensions/BackdropSourceExtension.cs
Outdated
Show resolved
Hide resolved
Following the naming scheme from the WUX/MUX AcrylicBrush
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/PipelineBrush/PipelineBrushXaml.bind
Show resolved
Hide resolved
Attempted workaround for "child node 2" build error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! Just need a small tweak to the sample for Acyclic and I think we're good to go. This definitely resolves the need for the 19041 workaround! Thanks!
Also, question on the Placement
property on the BlendEffect? For the Unicorn Image Source, setting it to Background
places it in-front of the brush in the 'Foreground', but setting it to Foreground
places it behind the rest of the pipeline in the 'Background'... should these be reversed or am I looking at this from the wrong perspective?
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/PipelineBrush/PipelineBrushXaml.bind
Show resolved
Hide resolved
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
@michael-hawker So, regarding the blend placement, it refers to the "current" pipeline, which is the main one from the brush in that case. Using This of course is just a matter of naming, I can revert them if you think that'll be more intuitive! |
@Sergio0694 let's discuss with some community folks and then we can create a separate PR inverting the property or changing the names to be clearer on what the behavior is around merging pipelines (or maybe they'll say the current makes sense). |
Follow up to #3112
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Effects are not extensible for the user, and there's no build-time check to ensure effects in a
PipelineBrush
instance are set in a valid order. Failing to do so will result in a runtime crash.What is the new behavior?
PipelineBrush
now has two separate properties:Input
andEffects
. There are two different interfaces to ensure there are build-time checks on effects assigned to either property.PipelineBrush
and into each concrete effect, users are now free to also create their own custom effects and plug them into aPipelineBrush
. They can do so by inheriting from eitherIPipelineInput
orIPipelineNode
.PR Checklist
Please check if your PR fulfills the following requirements: