Skip to content

Conversation

Zakariathr22
Copy link
Contributor

@Zakariathr22 Zakariathr22 commented Sep 15, 2025

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
Before
After
After

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)

@Saharsh979
Copy link

/azp run

@Saharsh979
Copy link

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.

</Page.Resources>
<StackPanel>
<StackPanel.ChildrenTransitions>
<RepositionThemeTransition />

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?

Copy link
Contributor

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

Copy link
Contributor Author

@Zakariathr22 Zakariathr22 Sep 18, 2025

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?

Copy link
Contributor

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
@Zakariathr22
Copy link
Contributor Author

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.

Done!

Copy link
Contributor

@AndrewKeepCoding AndrewKeepCoding left a 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>

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.

4 participants