Repository navigation
feat: add Tag option to control Expander header text orientation (Left/Right) - #253
Merged
ghost1372 merged 2 commits intoNov 13, 2026
Conversation
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Owner
|
@lihongfang16 cant we do this with Attached Properties? |
… instead of Tag Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Author
|
Thanks for the suggestion! Switched to an attached property: |
Owner
|
thank you |
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.
Problem
When
Expander.ExpandDirectionisLeftorRight, the header is rotated -90° as a whole: the text is arranged vertically, but every glyph lies on its side (you have to tilt your head to read it), and there is no way to control the header text orientation.Solution
Per review feedback, this uses an attached property instead of
Tag: a newhc:ExpanderElement.HeaderTextOrientation(enumExpanderHeaderTextOrientation:Default/Vertical/Horizontal), defined inControls/Attach/ExpanderElement.csfollowing the existingBorderElementpattern. The Left/Right templates name the headerContentPresenter(HeaderText) and add template triggers on the attached property:HeaderTextOrientationDefault)VerticalHorizontalNotes:
PathArrow) keeps its original -90° rotation and the outer layout geometry is unchanged;ExpanderUpTemplate/ExpanderDownTemplateare untouched, so the Up/Down default behavior is unaffected;HorizontalContentAlignmentto control where the text sits relative to the arrow (Left = away from the arrow (default) / Center = centered / Right = next to the arrow).Usage
Verification
dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj -f net8.0-windows: 0 warnings, 0 errors;Themes/Theme.xamlcontains the new triggers;HorizontalContentAlignmentcombinations all render as expected.