AutoLayout
children have conflicting HorizontalAlignment
behavior
#1361
Labels
kind/bug
Something isn't working
triage/untriaged
Indicates an issue requires triaging or verification.
Current behavior
If an
AutoLayout
has children and they haveHorizontalAlignment
set toCenter
they won't display at the center, but at the left side. However if you dynamically (eg. button click) change theirHorizontalAlignment
toCenter
they will move to the center.An UI update makes the
AutoLayout
children return to the left. For example, given the following XAML:TextBlock
s are aligned to the left.TextBlock
s'HorizontalAlignment
toCenter
via C#—this works, and they align to the center.MyAutoLayout
's orientation toVertical
.TextBlock
s return to the left.Recording.2025-03-05.175150.mp4
There's a power struggle between the
AutoLayout
Counter/PrimaryAlignment properties and the Horizontal/VerticalAlignments somewhere and they aren't being respected in the proper order of precedence.Expected behavior
There shouldn't be a conflict in
HorizontalAlignment
inAutoLayout
children. Questions that need answer:HorizontalAlignment
have effect on elements inside anAutoLayout
?utu:AutoLayout.PrimaryAlignment
andutu:AutoLayout.CounterAlignment
be used to modify elements alilgnment inside anAutoLayout
?How to reproduce it (as minimally and precisely as possible)
Repro
hd2034.zip <<<<<<<<<<<<<<<<<<<<<<
Nuget Package:
Uno.Toolkit.WinUI
:6.4.1
The text was updated successfully, but these errors were encountered: