-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Enable Grid to dynamically switch layouts#4474
feat: Enable Grid to dynamically switch layouts #4474nandin-borjigin wants to merge 4 commits intoCommunityToolkit:main from
Conversation
ghost
commented
Feb 2, 2022
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 🙌
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/GridExtensions/GridExtensionsPage.xaml
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/GridExtensions/GridExtensionsPage.xaml
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/GridExtensions/GridExtensionsPage.xaml
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI/Extensions/Grid/GridLayoutDefinition.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/GridExtensions/GridExtensionsPage.xaml
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI/Extensions/Grid/GridLayoutDefinition.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI/Extensions/Grid/GridLayoutDefinition.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.UI/Extensions/Grid/GridLayoutDefinition.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/GridExtensions/GridExtensionsCode.bind
Outdated
Show resolved
Hide resolved
Co-authored-by: XAML-Knight <86266896+XAML-Knight@users.noreply.github.com>
ghost
commented
Feb 3, 2022
This PR has been marked as "needs attention 👋" and awaiting a response from the team.
@XAML-Knight
XAML-Knight
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice implementation - like the simplicity in defining a grid layout
@Arlodotexe
Arlodotexe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. I might add some UI tests and potential test cases, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we maybe want to rename this AreaDefinitions (plural) to align with the others, RowDefinitions and ColumnDefinitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is only one area definition per layout definition, whereas row definitions and column definitions are multiple.
Uh oh!
There was an error while loading. Please reload this page.
Fixes #4470 CommunityToolkit/Labs-Windows#232
Added attached properties to
Gridelement to enable dynamic layout switching.PR Type
What kind of change does this PR introduce?
Feature
What is the current behavior?
We cannot switch
Gridlayouts 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 aGridelement and switch among them using the newly addedGridExtensions.ActiveLayout(string, it's the dictionary key of the corresponding layout definition) attached property associated with theGridelement.1
PR Checklist
Please check if your PR fulfills the following requirements: