WindowsCommunityToolkit
WindowsCommunityToolkit copied to clipboard
feat: Enable Grid to dynamically switch layouts
Fixes #4470 CommunityToolkit/Labs-Windows#232
Added attached properties to Grid
element to enable dynamic layout switching.
PR Type
What kind of change does this PR introduce?
Feature
What is the current behavior?
We cannot switch Grid
layouts dynamically once it's defined.
What is the new behavior?
One can define as many layouts (dictionary of string to GridLayoutDefinition
, a newly added data structure to describe a grid layout) as desired in a Grid
element and switch among them using the newly added GridExtensions.ActiveLayout
(string, it's the dictionary key of the corresponding layout definition) attached property associated with the Grid
element.
PR Checklist
Please check if your PR fulfills the following requirements:
- [ ] Tested code with current supported SDKs
- [x] New component
- [x] Pull Request has been submitted to the documentation repository instructions. Link: PR 602
- [ ] Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
- [ ] If control, added to Visual Studio Design project
- [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
- [ ] New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [x] Header has been added to all new source files (run build/UpdateHeaders.bat)
- [x] Contains NO breaking changes
Thanks nandin-borjigin for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request ๐
This PR has been marked as "needs attention ๐" and awaiting a response from the team.