Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Enable Grid to dynamically switch layouts#4474

Draft
nandin-borjigin wants to merge 4 commits intoCommunityToolkit:main from
nandin-borjigin:grid-dynamic-layout
Draft

feat: Enable Grid to dynamically switch layouts #4474
nandin-borjigin wants to merge 4 commits intoCommunityToolkit:main from
nandin-borjigin:grid-dynamic-layout

Conversation

@nandin-borjigin
Copy link

@nandin-borjigin nandin-borjigin commented Feb 2, 2022
edited
Loading

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.

1

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • New component
    • 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
  • Sample in sample app has been added / updated (for bug fixes / features)
  • 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)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Copy link

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 🙌

@ghost ghost requested review from azchohfi and michael-hawker February 2, 2022 13:22
@ghost ghost added the needs author feedback 📝 label Feb 2, 2022
Co-authored-by: XAML-Knight <86266896+XAML-Knight@users.noreply.github.com>
Copy link

ghost commented Feb 3, 2022

This PR has been marked as "needs attention 👋" and awaiting a response from the team.

Copy link
Contributor

@XAML-Knight XAML-Knight left a 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

@michael-hawker michael-hawker marked this pull request as draft February 3, 2022 21:33
@michael-hawker michael-hawker added extensions ⚡ feature 💡 labs 🧪 Marks an issue/PR involved with Toolkit Labs and removed needs attention 👋 labels Feb 3, 2022
Copy link
Member

@Arlodotexe Arlodotexe left a 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.

/// This usage is not really invalid (it does not throw),
/// but this API is not expected to be used like this.
/// </example>
public string AreaDefinition
Copy link
Member

@Arlodotexe Arlodotexe Feb 8, 2022

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?

Copy link
Author

@nandin-borjigin nandin-borjigin Feb 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Arlodotexe Arlodotexe Arlodotexe left review comments

@michael-hawker michael-hawker Awaiting requested review from michael-hawker

@azchohfi azchohfi Awaiting requested review from azchohfi

+1 more reviewer

@XAML-Knight XAML-Knight XAML-Knight approved these changes

Reviewers whose approvals may not affect merge requirements

At least 2 approving reviews are required to merge this pull request.

Assignees

No one assigned

Labels

extensions ⚡ feature 💡 labs 🧪 Marks an issue/PR involved with Toolkit Labs

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /