-
Notifications
You must be signed in to change notification settings - Fork 701
Add RepositionThemeTransition
to sample pages for smoother layout updates
#2047
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
base: main
Are you sure you want to change the base?
Add RepositionThemeTransition
to sample pages for smoother layout updates
#2047
Conversation
/azp run |
The PR description lacks the rationale behind why RepositionThemeTransition is added, which could confuse maintainers unfamiliar with it. Feel free to add more details along with the Before vs After Screenshot to give a visual sense of the improvement you're introducing. |
WinUIGallery/Samples/ControlPages/Accessibility/AccessibilityScreenReaderPage.xaml
Show resolved
Hide resolved
WinUIGallery/Samples/ControlPages/Accessibility/AccessibilityScreenReaderPage.xaml
Show resolved
Hide resolved
</Page.Resources> | ||
<StackPanel> | ||
<StackPanel.ChildrenTransitions> | ||
<RepositionThemeTransition /> |
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.
Modifying 74 files manually is an anti-pattern for maintainability.
Is there a way to avoid/minimize this? Can we think of adding a shared style for the applicable pages?
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.
Agreed, an ItemPageRootStackPanelStyle
(or something like that) that has these transitions included might be helpful - also in case we want to do add other standard properties in the future
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.
@Saharsh979 @niels9001 I have another idea
I introduced a new SamplePage
base class that automatically applies a RepositionThemeTransition
to the root Panel
of any derived page. This way, we don’t need to manually add transitions on pages with many examples (it’s handled consistently at the base level)
You can already see this applied to the BindingPage in this change 5b5f8c9
Should we extend this behaviour to all sample pages?
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.
Would love to get @marcelwgn's opinion here
- Added `SamplePage` as a base class for app pages - Applies `RepositionThemeTransition` to the root Panel of derived pages - Ensures transitions are applied only once to avoid duplicates
Done! |
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.
If we are reducing code for this implementation, we can create a style for these StackPanels.
<Style x:Key="StackPanelWithRepositionThemeTransitionStyle" TargetType="StackPanel">
<Setter Property="ChildrenTransitions">
<Setter.Value>
<TransitionCollection>
<RepositionThemeTransition />
</TransitionCollection>
</Setter.Value>
</Setter>
<Setter Property="Spacing" Value="12"/>
</Style>
Important
Do not merge until this is resolved
Description
Added
RepositionThemeTransition
to sample pages with many control examples for smoother layout updates.Motivation and Context
Improves visual consistency.
How Has This Been Tested?
Manually verified across affected sample pages to ensure transitions apply correctly without breaking layout.
Screenshots (if appropriate):
Before


After
Types of changes