-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add vertical alignment support to WrapPanel #3466
Comments
Hello vgromfeld, thank you for opening an issue with us! I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌 |
Thanks, @vgromfeld for highlight this. Padding has been a known issue similar to #3257 and #3416 |
What other Panels offer VerticalContentAlignment and HorizontalContentAlignment? StackPanel does not, and Grid does not. Why offer it for the WrapPanel? |
Thanks @skendrot I agree that we should just be inspecting the child's alignment property in the layout pass of the panel vs. a separate property, I commented more in the pr here. The bug itself here about the property currently not being respected is a valid concern still though. I think we can just pivot the solution a bit. |
…lAlignment support to WrapPanel (#3471) ## Fixes #3466 This PR adds the support of the `FrameworkElement.VerticalAlignment` and `FrameworkElement.HorizontalAlignment` to `WrapPanel`. ## PR Type What kind of change does this PR introduce? - Bugfix ## What is the current behavior? The wrap panel is always top/left aligning its children. ## What is the new behavior? The controls will now use the children alignment to properly align them inside their row/column. The `Arrange` code has been updated and is now a two steps process. The position and size of all the controls are stored in a new `UvRect` structure. Those `UvRect` are grouped by `Row`. This allows us to get the final height of the row before drawing the children so we can adjust their position. **VerticalAlignment.Top** ![image](https://user-images.githubusercontent.com/20152272/92946831-74f88e80-f457-11ea-9467-1e3124ef837a.png) **VerticalAlignment.Center** ![image](https://user-images.githubusercontent.com/20152272/92946849-7c1f9c80-f457-11ea-8a1c-868438d9da90.png) ![image](https://user-images.githubusercontent.com/20152272/92946920-978aa780-f457-11ea-9928-1346b5cf3a8e.png) **VerticalAlignment.Bottom** ![image](https://user-images.githubusercontent.com/20152272/92946873-8772c800-f457-11ea-86ae-049fbe1676ab.png) **VerticalAlignment.Stretch** ![image](https://user-images.githubusercontent.com/20152272/92946900-90fc3000-f457-11ea-8f70-fe01db58930a.png) ## PR Checklist Please check if your PR fulfills the following requirements: - [x] Tested code with current [supported SDKs](../readme.md#supported) - [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link --> - [x] Sample in sample app has been added / updated (for bug fixes / features) - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets) - [ ] Tests for the changes have been added (for bug fixes / features) (if applicable) - [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [x] Contains **NO** breaking changes
Describe the bug
The
WrapPanel
control does not respect the required vertical alignments of its children controls.Steps to Reproduce
Steps to reproduce the behavior:
Expected behavior
The panel should vertically align the children based on their vertical alignment values.
Screenshots
Actual behavior
Expected behavior (using a stack panel)
The text was updated successfully, but these errors were encountered: