Repository navigation
fix: Implement IOrientedPanel on ItemsStackPanel (fixes #25266) - #25855
MartinZikmund merged 1 commit into
Conversation
…5266) Selector.GetItemsHostOrientations only recognized StackPanel and IOrientedPanel, so a horizontal ItemsStackPanel was reported as Vertical. Like WinUI, ItemsStackPanel now implements IOrientedPanel, with both the logical and physical orientation equal to Orientation.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242770 found UI Test snapshots differences: Details
|
|
|
|
|
5511d77 to
9ae963a
Compare
|
This pull request is merged. |
MartinZikmund
left a comment
There was a problem hiding this comment.
Thanks @seragAhmed! This matches WinUI 1:1 (ItemsStackPanel_Partial.cpp: get_LogicalOrientation returns Orientation, get_PhysicalOrientation forwards to it), and the test fails without the fix as it should.
Optional nit: the ItemsStackPanel arm in ListViewBase.GetPanelOrientation() (ListViewBase.DragDrop.mux.cs) is now redundant, and its comment saying ItemsStackPanel doesn't implement IOrientedPanel is stale. Feel free to drop the arm and fix the comment, or leave it for a follow-up.
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247855 found UI Test snapshots differences: Details
|
|
🎉 Congratulations on getting your very first pull request merged into Uno Platform! This is a huge milestone — you are now officially part of the community of contributors helping shape the future of cross-platform .NET development, and your code will reach developers and apps all over the world. 🌍 |

GitHub Issue: closes #25266
PR Type:
🐞 Bugfix
What changed? 🚀
Selector.GetItemsHostOrientations()only recognizesStackPanelandIOrientedPanel.ItemsStackPaneldid not implementIOrientedPanel, so aListView/ComboBoxusing a horizontalItemsStackPanelwas reported as(Vertical, Vertical).Like WinUI,
ItemsStackPanelnow implementsIOrientedPanel:LogicalOrientationreturnsOrientationPhysicalOrientationreturnsOrientation(WinUI'sget_PhysicalOrientationforwards to the logical orientation for this panel)These are explicit interface implementations, so the public API surface is unchanged. The existing
internal override Orientation? PhysicalOrientationonPanelis untouched.ItemsWrapGrid(where physical is the opposite ofOrientation) is not implemented in Uno, so it is out of scope.Validation
Given_Selector([GitHubWorkItem]Selector.GetItemsHostOrientations reports Vertical for a horizontal ItemsStackPanel #25266):When_ItemsStackPanel_GetItemsHostOrientations, data-driven forHorizontalandVertical. It calls the protectedGetItemsHostOrientations()through a smallSelectorsubclass with anItemsStackPanelasItemsPanelRoot, and checks both orientations.Horizontalcase fails (Expected:<Horizontal>. Actual:<Vertical>); theVerticalcase passes either way.Given_Selector,Given_ListViewBase*,Given_ComboBox,Given_ItemsControl(net10.0): 84 passed, 3 skipped, 0 failed.Uno.UI.UnitTestsrun (net10.0, Windows): 4443 passed, 23 skipped, 12 failed. The 12 failures are allWhen_Calendar.When_Gregorian_FixedDate*, which depend on the machine's local time zone (UTC+3 here), fail the same way on branches that don't touch these types, and are unrelated to this change.PR Checklist ✅
Screenshots Compare Test Runresults.