Skip to content

Add ContentPresenter to Logical Tree helpers #3811

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

Conversation

michael-hawker
Copy link
Member

Fixes N/A

As I was writing the SwitchPresenter docs, I was doing some tests about how it loads/doesn't load content into the VisualTree. I noticed the VisualTree could find the descendants, but our logical helpers could not.

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Can't find the loaded children in the Logical Tree.

What is the new behavior?

If ContentPresenter (like SwitchPresenter) have content which are also Framework Elements (and not data) then we'll continue walking like we would with a ContentControl.

This is important as some templates for controls use ContentPresenter more often than ContentControl in other places as ContentPresenter is lighter-weight than ContentControl.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • 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

Helps get down through SwitchPresenter. (Up doesn't work as Parent is not being set, WinUI bug?)
@ghost
Copy link

ghost commented Mar 5, 2021

Thanks michael-hawker 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
Copy link

ghost commented Mar 5, 2021

Hello @michael-hawker!

Because this pull request has the auto merge :zap: label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor note, but looks good! 😄

Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚀

@michael-hawker michael-hawker merged commit 9fd53a6 into CommunityToolkit:master Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants