Skip to content
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

feat: Enable Grid to dynamically switch layouts #4472

Closed
wants to merge 1 commit into from

Conversation

nandin-borjigin
Copy link

@nandin-borjigin nandin-borjigin commented Jan 30, 2022

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
  • New component
    • Pull Request has been submitted to the documentation repository instructions. Link:
    • 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

Other information

Document will be provided soon while this PR is being reviewed and discussed.

@ghost
Copy link

ghost commented Jan 30, 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 michael-hawker and azchohfi January 30, 2022 15:29
@net-foundation-cla
Copy link

net-foundation-cla bot commented Jan 30, 2022

CLA assistant check
All CLA requirements met.

@net-foundation-cla
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ nandin-borjigin sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@XAML-Knight
Copy link
Contributor

Hi @nandin-borjigin, it appears you're trying to merge this code in from the main/master branch of your forked repo.

Please be aware of the rules & stipulations of submitting code into the Toolkit repo:

image

@michael-hawker
Copy link
Member

@nandin-borjigin appreciate your enthusiasm! It'd be good for us to get some feedback from the community on your proposal. We should hopefully have a new process for prototypes and experiments like this in the next few weeks that would be good to help hone your idea.

I noticed that you had a string based AreaDefinition property? I didn't really understand all the parsing that was happening there and what was trying to be done there?

@michael-hawker michael-hawker marked this pull request as draft January 31, 2022 18:35
@nandin-borjigin
Copy link
Author

Closing since the PR was made from main branch of forked repository. New PR is made #4474 .

@michael-hawker I'll add comments in the code for your question :). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants