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

Filter GetVisualTreeDescendants to not check elements with null handlers #18539

Merged

Conversation

drasticactions
Copy link
Contributor

@drasticactions drasticactions commented Nov 6, 2023

Description of Change

Filter VisualElements that don't have handlers set from being returned inside GetVisualTreeDescendants. Calls to this method that contain elements that don't have handlers set would throw Handler exceptions as it's null.

Issues Fixed

Fixes #16919

@drasticactions
Copy link
Contributor Author

We're still talking about the best ways to handle StrokeShape. IMO this is more of a "Workaround" for the general issue linked above. By this point in the views lifecycle, they should have a handler (You invoke these APIs by giving an x, y target or by calling an existing IVisualTreeElement, which should be an element that exists and is visible in the visual tree). The issue are some elements like Border.StrokeShape that use elements that "do" have handlers, but are not set and they are not directly drawn on UI.

@drasticactions drasticactions marked this pull request as ready for review November 6, 2023 17:11
@drasticactions drasticactions requested a review from a team as a code owner November 6, 2023 17:11
@chabiss chabiss added this to the .NET 8 SR1 milestone Nov 6, 2023
@drasticactions drasticactions enabled auto-merge (squash) November 7, 2023 17:56
@drasticactions drasticactions merged commit bb90908 into dotnet:main Nov 7, 2023
47 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
@samhouts samhouts added the fixed-in-8.0.6 Look for this fix in 8.0.6 SR1! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-8.0.6 Look for this fix in 8.0.6 SR1!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shapes without handlers shouldn't be added as LogicalChildren
4 participants