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

fix: Update Scroll View Animation Example and Sample Code Presenter #1616

Merged

Conversation

Zakariathr22
Copy link
Contributor

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:

    • 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.

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:

image
image
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

- **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.
@Zakariathr22 Zakariathr22 marked this pull request as draft August 23, 2024 18:28
@Zakariathr22 Zakariathr22 marked this pull request as ready for review August 23, 2024 18:28
…nd `GetTargetVerticalOffset` functions to sample codes for better understanding
}
if (nbAnimationDuration != null)
Example3.CSharp = Example3.CSharp.Replace("nbAnimationDuration.Value", nbAnimationDuration.Value.ToString());
Example3.UpdateLayout();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed indentation

@karkarl
Copy link
Collaborator

karkarl commented Nov 13, 2024

/azp run

@karkarl karkarl merged commit f1a2e82 into microsoft:main Nov 13, 2024
2 checks passed
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
@Zakariathr22 Zakariathr22 deleted the scrollview-animation-sample-updates branch December 2, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants