fix: Update Scroll View Animation Example and Sample Code Presenter#1616
Merged
karkarl merged 3 commits intomicrosoft:mainfrom Nov 13, 2024
Merged
Conversation
- **Added Sample Code Files**:
- Included three new sample code files for different scroll animations:
- `ScrollViewSample3_DefaultAnimation_cs.txt`
- `ScrollViewSample3_AccordionAnimation_cs.txt`
- `ScrollViewSample3_TeleportationAnimation_cs.txt`
- **Updated Sample Code for Scroll Animations**:
- Provided sample code for three types of animations (Default, Accordion, Teleportation) to be used in the `ScrollView_ScrollAnimationStarting` method.
- **Updated Sample Code for Animation Duration Handling**:
- Implemented dynamic updating to ensure that the animation duration is reflected in the displayed sample code when the value changes.
- **Updated `ReevaluateVisibility` Method**:
- Modified the `ReevaluateVisibility` method in `SampleCodePresenter` to only collapse the visibility when the content is empty. Leave the updated method visibility management to `HandlePresenterVisibility()` only in `ControlExample` to prevent overlap of XAML and C# code.
…nd `GetTargetVerticalOffset` functions to sample codes for better understanding
karkarl
reviewed
Sep 27, 2024
| } | ||
| if (nbAnimationDuration != null) | ||
| Example3.CSharp = Example3.CSharp.Replace("nbAnimationDuration.Value", nbAnimationDuration.Value.ToString()); | ||
| Example3.UpdateLayout(); |
Contributor
Author
There was a problem hiding this comment.
Fixed indentation
karkarl
approved these changes
Nov 13, 2024
Collaborator
|
/azp run |
3 tasks
Zakariathr22
added a commit
to Zakariathr22/WinUI-Gallery
that referenced
this pull request
Nov 26, 2024
Zakariathr22
added a commit
to Zakariathr22/WinUI-Gallery
that referenced
this pull request
Nov 27, 2024
Merged
3 tasks
niels9001
pushed a commit
that referenced
this pull request
Dec 6, 2024
…and `ScrollViewPage` Example (#1668) ## Description This PR reverts changes introduced in #1616 to the `ReevaluateVisibility` method in the `SampleCodePresenter` class. The modifications in #1616 caused unintended side effects, including the issue observed on the icons page. Reverting these changes resolves the problem and restores expected behavior. Additionally, this PR includes: - **Fix for overlapping issue with `SampleCodePresenter`:** Updates `ControlExample` to use `ContentPresenter` for visibility management, ensuring no overlapping when C# code changed. - **Ensure correct C# code sample updates when animation duration changes.** ## Motivation and Context Fixing the issue on the icons page caused by unintended side effects of changes in #1616, ensuring proper visibility management for code presenters without affecting other functionality. Additional fixes address overlapping issues and dynamic sample updates to enhance usability. ## How Has This Been Tested? Manually tested: - Verified that reverting #1616 changes to the `ReevaluateVisibility` method. - Confirmed that overlapping of code presenters is resolved. - Ensured the animation duration is correctly updated in the displayed C# code in the ScrollView example. ## Screenshots (if appropriate): - **Before reverting:**  - **After reverting:**  - **Before resolving overlapping issue:**  - **After resolving overlapping issue:**  ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to change)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Updated ScrollView Animation sample to display C# code, include default, accordion, and teleportation animations, and fixed code visibility handling to prevent overlap. With dynamically updated animation duration in the code displayed, main changes are:
Added Sample Code Files:
ScrollViewSample3_DefaultAnimation_cs.txt-ScrollViewSample3_AccordionAnimation_cs.txt-ScrollViewSample3_TeleportationAnimation_cs.txtUpdated Sample Code for Scroll Animations:
ScrollView_ScrollAnimationStartingmethod.Updated Sample Code for Animation Duration Handling:
Updated
ReevaluateVisibilityMethod:ReevaluateVisibilitymethod inSampleCodePresenterto only collapse the visibility when the content is empty. Leave the updated method visibility management toHandlePresenterVisibility()only inControlExampleto prevent overlap of XAML and C# code.Motivation and Context
By adding and updating sample code for different scroll animations (default, accordion, and teleportation), users can better understand and implement various animation styles in their ScrollView components.
It is also fixing this issue: #1603
How Has This Been Tested?
The changes were manually tested by verifying that the correct sample code is displayed for different animations, ensuring dynamic updates to the animation duration in the displayed example code, and confirming that the code presenter visibility is correctly managed.
Screenshots:
Types of changes