-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ScrollViewer expression animations extensions #3220
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
ScrollViewer expression animations extensions #3220
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 🙌 |
@Sergio0694 just going through other issues and saw #1499, can you help me understand how these two things relate? |
@michael-hawker Those looks like unrelated extensions, if not for the fact that they (indirectly) both work on a target |
It could be cool to have a sample to show you how you'd setup that sort of syncing as a sample page. |
Added a sample in the For instance, Let me know if there are any other changes I should do! 😊 |
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.
Small nitpick to make the sample shine, but otherwise this is really cool!
@azchohfi I was late on reviewing this before due to all my PC/Internet troubles. This is small and isolated, so seems low-risk to take this late. You good with that?
...oft.Toolkit.Uwp.SampleApp/SamplePages/ScrollViewerExtensions/ScrollViewerExtensionsXaml.bind
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI/Extensions/ScrollViewer/ScrollViewerExtensions.cs
Outdated
Show resolved
Hide resolved
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
I'll pull this down and re-review now, but I think we'll be good! |
All good, we should Squash and Merge this one again, as there's the weird history coming from @Sergio0694's branches. Hopefully we can get that reset and fixed in future PRs. 😋 |
This PR is part of the group being tracked in #3108.
PR Type
What kind of change does this PR introduce?
What is the new behavior?
Two extension methods for the
ScrollViewer
class that can be used to easily create and start expression animations that bind the scrolling translation on a specified axis of the source scroller, to the offset on a given axis of a target control. This can be used to keep "in sync" the contents of aScrollViewer
with some overlays rendered on another surface that is not part of theScrollViewer
, as the expression animation will adjust the offset of the external surface to perfectly follow its content.Here it is in action, you can see that there is some text inside a
RichEditBox
, and these new extensions are used to keep the text in sync with the text overlays (the dashed column guides and the TAB arrows) and the indentation indicators on the left, which are all rendered in a Win2D canvas outside of theScrollViewer
within the text control. Additionally, the line number are displayed through aTextBlock
living in aCanvas
, which is also kept in sync with the text in the same way:PR Checklist
Please check if your PR fulfills the following requirements:
Icon has been created (if new sample) following the Thumbnail Style Guide and templatesOther information
cc. @michael-hawker - would you like me to create a sample/docs page for these two extensions, or is it not needed since they're just two small extensions in an already existing class? Keeping this as a draft PR for now since I'm not sure about this specific point 😄