Skip to content

Add Support For Expander In FindChild #624

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adstep
Copy link

@adstep adstep commented Feb 11, 2025

Fixes

Addresses #472

Adds support for searching an Expander control's header. The current logic only searches the content of the Expander control, but not the header.

PR Type

What kind of change does this PR introduce?

Bugfix

What is the current behavior?

Doesn't find framework elements in the header of an Expander control.

What is the new behavior?

Finds framework elements in the header of an Expander control.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • Tested code with current supported SDKs
  • Contains NO breaking changes

Other information

No tests. I believe the Logical Tree Tests are not being run (#474).

@adstep adstep changed the title Add cases for handling expander's header when searching usercontrols. Add Support For Expander In FindChild Feb 11, 2025
}
else if (element is ContentControl contentControl)
{
if (element is Expander expander)
Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure why Github is picking this up as changing the entire file. I only made some small additions to add cases for the Expander under ContentControl.

Copy link
Author

Choose a reason for hiding this comment

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

Is it picking up line ending changes? I'm using VSCode and it should be picking up the editorconfig settings?

Copy link
Author

Choose a reason for hiding this comment

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

image

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it was a tab/space thing, hard to tell in the GitHub view what actual characters changed.

image

If I toggle the hide whitespace feature then we can see the actual changes, but we should ensure the whitespace isn't change for consistency within the repo (and not having a large diff).

Copy link
Member

@michael-hawker michael-hawker left a comment

Choose a reason for hiding this comment

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

Regardless of the formatting issue, I don't think we want to take this fix. I added a comment in the original issue, but Headers aren't children to the control.

If this is a scenario you need, you can use the predicate to find the parent container.

If we did do anything here, we'd probably want to generalize it to anything with a header, not just expander. And it'd be a new specific method that searches "everything" like FindChildOrHeader

}
else if (element is ContentControl contentControl)
{
if (element is Expander expander)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it was a tab/space thing, hard to tell in the GitHub view what actual characters changed.

image

If I toggle the hide whitespace feature then we can see the actual changes, but we should ensure the whitespace isn't change for consistency within the repo (and not having a large diff).

@michael-hawker michael-hawker marked this pull request as draft February 11, 2025 20:00
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